Nginx部署ThinkPHP3.x心得
2015-12-23 00:00
766 查看
使用LNMP一键安装之后,由于Nginx不支持pathinfo,所以对nginx和php做了修改
修改/usr/local/nginx/conf/nginx.conf
修改 /usr/local/php/etc/php.ini
修改/usr/local/nginx/conf/nginx.conf
server { listen 80 default_server; #listen [::]:80 default_server ipv6only=on; server_name www.lnmp.org; index index.html index.htm index.php; root /home/wwwroot/default; #error_page 404 /404.html; # include enable-php.conf; location /nginx_status { stub_status on; access_log off; } location / { try_files $uri @rewrite; } location @rewrite { set $static 0; if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) { set $static 1; } if ($static = 0) { rewrite ^/(.*)$ /index.php?s=/$1; } } location ~ /Uploads/.*\.php$ { deny all; } location ~ \.php/ { if ($request_uri ~ ^(.+\.php)(/.+?)($|\?)) { } fastcgi_pass unix:/tmp/php-cgi.sock; include fastcgi_params; fastcgi_param SCRIPT_NAME $1; fastcgi_param PATH_INFO $2; fastcgi_param SCRIPT_FILENAME $document_root$1; } location ~ \.php$ { fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\. { deny all; } access_log /home/wwwlogs/access.log access; }
修改 /usr/local/php/etc/php.ini
cgi.fix_pathinfo=1
相关文章推荐
- nginx-rtmp-module和simple-rtmp-server搭建
- 1.8LNMP环境安装Nginx
- Nginx基础入门之Nginx的工作原理
- CentOS_6.5安装Nginx+PHP+MySQL
- nginx学习笔记
- 实战Nginx与PHP(FastCGI)的安装、配置与优化
- Nginx报错403 forbidden (13: Permission denied)的解决办法
- Nginx集成SSL
- Ubuntu下安装Nginx,PHP5(及PHP-FPM),MySQL
- [置顶] nginx 访问静态html 方式
- nginx Thinkphp rewrite
- Nginx配置文件nginx.conf中文详解
- Centos中升级nginx
- 终结者:具体解释Nginx(一)
- Nginx安全配置研究
- nginx服务器安装及配置文件详解
- linux 下安装 nginx
- “惊群”,看看nginx是怎么解决它的
- nginx核心进程模型
- 解决nginx reload失败