2026-03-21 02:33:14 +08:00
|
|
|
|
# 站点1:默认 80 端口
|
2026-03-10 13:50:35 +08:00
|
|
|
|
server {
|
|
|
|
|
|
listen 80;
|
|
|
|
|
|
server_name 127.0.0.1;
|
|
|
|
|
|
|
|
|
|
|
|
root /Users/apple/scott2026/huangjingfen/pro_v3.5.1/public;
|
2026-03-21 02:33:14 +08:00
|
|
|
|
index index.html index.php;
|
|
|
|
|
|
|
|
|
|
|
|
location ~* \.(php|jsp|cgi|asp|aspx)$ {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:20199;
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
|
if (!-e $request_filename) {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:20199;
|
|
|
|
|
|
}
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
|
proxy_read_timeout 360s;
|
|
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
|
|
|
|
add_header X-Cache $upstream_cache_status;
|
|
|
|
|
|
add_header Cache-Control no-cache;
|
|
|
|
|
|
expires 12h;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# 站点2:81 端口(远程 MySQL: fsgx-shop)
|
|
|
|
|
|
server {
|
|
|
|
|
|
listen 81;
|
|
|
|
|
|
server_name 127.0.0.1;
|
|
|
|
|
|
|
|
|
|
|
|
root /Users/apple/scott2026/huangjingfen/pro_v3.5.1/public;
|
2026-03-10 13:50:35 +08:00
|
|
|
|
index index.html index.php;
|
|
|
|
|
|
|
|
|
|
|
|
location ~* \.(php|jsp|cgi|asp|aspx)$ {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:20199;
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
|
if (!-e $request_filename) {
|
|
|
|
|
|
proxy_pass http://127.0.0.1:20199;
|
|
|
|
|
|
}
|
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
|
proxy_read_timeout 360s;
|
|
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
|
|
|
|
add_header X-Cache $upstream_cache_status;
|
|
|
|
|
|
add_header Cache-Control no-cache;
|
|
|
|
|
|
expires 12h;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|