server {
listen 80;
listen [::]:80;
server_name _;
root /var/www/html/xxx;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
}
nginx.conf配置如下内容
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}