server { listen 80; server_name 1.14.93.182; root /var/www/html/cart/public; index index.php admin.php index.html index.htm; location ^~ /admin.php/ { if (!-e $request_filename){ rewrite ^\/admin\.php(.*)$ /admin.php?s=$1 last; break; } } location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } location ~ ^(.+\.php)(.*)$ { fastcgi_pass php-www:9000;#php-fpm的默认端口是9000 fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } location ~ /\.ht { deny all; } location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } }