server{ listen 18702; server_name "127.0.0.1"; index index.php; root /var/www/html/byjd; location ~ \.php(.*)$ { fastcgi_pass php-fpm:9000; include fastcgi_params; fastcgi_param PATH_INFO $1; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location / { if (!-e $request_filename) { rewrite ^/index.php(.*)$ /index.php?s=$1 last; rewrite ^(.*)$ /index.php?s=$1 last; break; } } }