标签(空格分隔): linux


nginx配置文件:

  1. server
  2. {
  3. listen 81;
  4. #listen [::]:80;
  5. server_name _;
  6. index index.html index.htm index.php default.html default.htm default.php;
  7. root /home/wwwroot/thinkphp5.0.5/public;
  8. include rewrite/other.conf;
  9. #error_page 404 /404.html;
  10. # Deny access to PHP files in specific directory
  11. #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
  12. include enable-php-pathinfo.conf;
  13. # --start--- TP5加上这一块 支持pathinfo
  14. if (!-e $request_filename) {
  15. rewrite ^/(.*)$ /index.php/$1 last;
  16. break;
  17. }
  18. location ~ [^/]\.php(/|$) {
  19. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  20. try_files $fastcgi_script_name =404;
  21. set $path_info $fastcgi_path_info;
  22. fastcgi_param PATH_INFO $path_info;
  23. fastcgi_pass unix:/dev/shm/php-cgi.sock;
  24. fastcgi_index index.php;
  25. include fastcgi.conf;
  26. }
  27. # --end--- TP5加上这一块 支持pathinfo
  28. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  29. {
  30. expires 30d;
  31. }
  32. location ~ .*\.(js|css)?$
  33. {
  34. expires 12h;
  35. }
  36. location ~ .*\.(js|css)?$
  37. {
  38. expires 12h;
  39. }
  40. location ~ /.well-known {
  41. allow all;
  42. }
  43. location ~ /\.
  44. {
  45. deny all;
  46. }
  47. access_log /home/wwwlogs/thinkphp5.0.5.log;
  48. }

Nginx下部署TP5项目的更多相关文章

  1. Nginx下部署Laravel项目

    Nginx下部署Laravel项目 标签(空格分隔): php Nginx配置文件 listen 80 default_server; #listen [::]:80 default_server i ...

  2. Linux下部署tp5项目如何隐藏URL中index.php

    找到nginx配置文件,加入以下代码: location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php?s=/$1 last; ...

  3. 在nginx上部署vue项目(history模式);

    在nginx上部署vue项目(history模式): vue-router 默认是hash模式,使用url的hash来模拟一个完整的url,当url改变的时候,页面不会重新加载.但是如果我们不想has ...

  4. Linux 下部署Django项目

    Linux 下部署Django项目   说明:本文所使用的环境为CentOS 6+Python2.7+Django1.11 安装Django.Nginx和uWSGI 1.确定已经安装了2.7版本的Py ...

  5. 在nginx上部署vue项目(history模式)--demo实列;

    在很早之前,我写了一篇 关于 在nginx上部署vue项目(history模式) 但是讲的都是理论,所以今天做个demo来实战下.有必要让大家更好的理解,我发现搜索这类似的问题还是挺多的,因此在写一篇 ...

  6. 在IIS下部署Thinkphp项目,验证码不能显示的解决办法

    由于公司租用的是虚拟空间,而且用的是IIS服务器,所以部署PHP的时候就出现很多问题:比如昨天就碰到这个问题:在IIS下部署Thinkphp项目,验证码不能显示 这是生成验证码的方法: // 制作专门 ...

  7. Tomcat—怎样在Tomcat Webserver下部署Web项目

            总结一下怎样在Tomcat Webserver下部署Web项目:

  8. linux下部署php项目-Apache、php、mysql关联

    linux下部署php项目环境可以分为两种,一种使用Apache,php,mysql的压缩包安装,一种用yum命令进行安装. 使用三种软件的压缩包进行安装,需要手动配置三者之间的关系.apache和p ...

  9. tpadmin的坑收集 nginx下配置tp5失败

    如下: 1.ADMIN模块如要关联查询,model的函数名一定不要有“_”下划线,否则找不到 /common/model/**.php 如果把函数名file写成“**_file”,调用时,$vo.** ...

随机推荐

  1. HDU 4311 Contest 2

    求的是曼哈顿距离.可以把X,Y的距离分开来求.其中,求X.Y的距离可以通过排序后递推的方式求出值的. #include <iostream> #include <algorithm& ...

  2. vue 路由demo2

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. bzoj3295: [Cqoi2011]动态逆序对(cdq分治+树状数组)

    3295: [Cqoi2011]动态逆序对 题目:传送门 题解: 刚学完cdq分治,想起来之前有一道是树套树的题目可以用cdq分治来做...尝试一波 还是太弱了...想到了要做两次cdq...然后伏地 ...

  4. 使用LSTM做电影评论负面检测——使用朴素贝叶斯才51%,但是使用LSTM可以达到99%准确度

    基本思路: 每个评论取前200个单词.然后生成词汇表,利用词汇index标注评论(对 每条评论的前200个单词编号而已),然后使用LSTM做正负评论检测. 代码解读见[[[评论]]]!embeddin ...

  5. react-route4 按需加载配置心得

    本篇文章主要记录笔者项目中使用 react-route + webpack 做路由按需加载的心得,可能只有笔者一个人看,权当日记了.   很久很久以前,react-route还是2.X和3.X版本的时 ...

  6. Chrome浏览器查看SSL证书信息

    1.https使用f12打开,选中security 如果F12打不开,可以通过最右端的自定义及控制chrome菜单,打开"更多工具"-->"开发者工具" ...

  7. C#--DataGridView添加DateTimePicker时间控件

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. 转:IE 无法使用 js trim() 的解决方法

    http://hi.baidu.com/yuiezt/item/756d0f4ec4d2640ec11613f9   var aa = $("#id").val().trim()  ...

  9. 1、Windows服务器 VS Linux服务器

  10. js语法之条件语句

    一.比较操作符 比较操作符包括:等于(==).大于(>).大于等于(>=).小于(<).小于等于(<=).