thinkphp比较完美的nginx配置
来源:互联网 发布:数学工具书 知乎 编辑:程序博客网 时间:2024/05/22 13:24
原地址:http://www.thinkphp.cn/topic/34380.html
server {
listen 80;server_name thinkphp.lo;
root /var/www;
index index.html index.htm index.php;
error_page 404 /404.html;
location = /404.html {
return 404 'Sorry, File not Found!';
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html; # windows用户替换这个目录
}
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 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_NAME $1;
fastcgi_param PATH_INFO $2;
fastcgi_param SCRIPT_FILENAME $document_root$1;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
0 0
- thinkphp比较完美的nginx配置
- 让nginx完美支持Thinkphp的配置
- thinkphp nginx下面完美配置解决404 file not found
- Thinkphp Nginx下的配置
- 最完美ThinkPHP Nginx 配置文件
- 最完美解决Nginx部署ThinkPHP项目的办法
- 最完美解决Nginx部署ThinkPHP项目的办法
- 最完美解决Nginx部署ThinkPHP项目的办法
- 最完美解决Nginx部署ThinkPHP项目的办法
- thinkphp nginx下面完美配置解决404 file not found(让nginx支持PATHINFO路由模式)
- 配置nginx适应Thinkphp的URL rewrite
- Thinkphp在Nginx上的配置
- 配置修改Nginx支持ThinkPHP的PATHINFO
- nginx配置 thinkphp需要的pathinfo
- 关于nginx支持thinkphp框架的配置
- nginx服务器下部署ThinkPHP的配置
- ThinkPHP在Nginx上的URL配置
- nginx配置ThinkPHP Rewrite
- 选项卡面向对象写法
- SQL——高级教程概述
- 英文投稿的一点经验
- [生存志] 第141节 秦魏风俗掌故
- 列表框
- thinkphp比较完美的nginx配置
- Practice6_2_map_sort_by_comparator
- Hibernate环境配置
- Retrofit使用与解析
- hdu 1271 整数对(找规律)
- Ubuntu下gcc多版本共存和版本切换
- apache启动失败原因
- C+++多态性
- OpenGL ES总结(一)OpenGL 初识