PHP项目配置伪静态

server
{
    listen 80;
    server_name local.jnwy.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /Applications/workspace/fancy/php/jnwyApi/public;

    location ~ \.php$ {
       fastcgi_pass  unix:/Applications/xserver/service/php/7.4.30/php-cgi.sock;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
    }

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


    access_log /Applications/xserver/service/nginx/1.20.2/logs/access-local.jnwy.com-80.log;
    error_log  /Applications/xserver/service/nginx/1.20.2/logs/error-local.jnwy.com-80.log;
}

 

posted @ 2025-05-14 14:21  七彩鱼丸  阅读(16)  评论(0)    收藏  举报