修改thinkphp配置nginx服务器,thinkphp5.0配置nginx重写规则
thinkphp5.0配置nginx重寫規則
2018年07月06日 09:29:03閱讀數:1529
server {
listen 80; #端口號
server_name demo.aa.com; #域名
access_log /data/rootlogs/demo.aa.com_nginx.log combined;#日志
index index.html index.htm index.php;
root /data/root/default/public/; #路徑
include /usr/local/nginx/conf/rewrite/none.conf;
#error_page 404 /404.html;
#error_page 502 /502.html;
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /\.ht {
deny all;
}
}
版權申明:本博文版權歸博主所有,轉載請注明地址!如有侵權、違法,請聯系admin@php.cn舉報處理!
全部評論
文明上網理性發言,請遵守新聞評論服務協議0條評論
立即提交
總結
以上是生活随笔為你收集整理的修改thinkphp配置nginx服务器,thinkphp5.0配置nginx重写规则的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: angluar ajax实例,Angul
- 下一篇: phpstudy(小皮面板)Deepin