nginx 配置tp3.2.3的问题

浏览:347 发布日期:2019/04/18 分类:求助交流 关键字: nginx
nginx大概是配置好了,不过我访问的时候:

IP/index.php (这里php后面不加/就会下载index.php,加上/就能正常访问是为啥)server {
        listen  80 default_server;
        server_name  192.168.8.2;
        index  index.html index.htm index.php;
        root    /home/wwwroot/tp;

        location ~ [^/]\.php(/|$)  {
             fastcgi_pass unix:/tmp/php-cgi.sock;
             fastcgi_index index.php;
             fastcgi_split_path_info  ^(.+\.php)(/.*);
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_param SCRIPT_NAME $fastcgi_script_name;
             fastcgi_param  PATH_INFO $fastcgi_path_info;
             include fastcgi.conf;
             include fastcgi_params;
         }

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

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

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

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }
        
        access_log  /home/wwwlogs/access.log;

    }
最佳答案
评论( 相关
后面还有条评论,点击查看>>