Linux

nginx去掉index.php配置

作者:admin 来源:web交流网 2019-12-31 23:28 浏览:0 我要评论(0)

进入:nginx conf nginx conflocation { if (!-e $request_filename) { re

进入:nginx/conf/nginx.conf
location / {
            if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
            }
}

完整如下

server
    {
        listen 80;
        #listen [::]:80 default_server ipv6only=on;
        server_name jiqing.dexin.com;
        index index.html index.htm index.php admin.php;
        root  /home/wwwroot/default/dexin/dragon/public;

        #error_page   404   /404.html;
        include enable-php-pathinfo.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            deny all;
        }

        location / {
            if (!-e $request_filename) {
                rewrite  ^(.*)$  /index.php?s=/$1  last;
            }
        }

        access_log  /home/wwwlogs/access.log;
    }

转载请注明出处。

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源;3.作者投稿可能会经我们编辑修改或补充。

网友点评
评论(已有0条评论)
还没有评论,快来抢沙发吧!
新闻
  • 新闻
  • 软件
精彩导读