You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
942 B
30 lines
942 B
server { |
|
listen 80; |
|
|
|
location / { |
|
root /var/www/html/; |
|
index index.html index.htm; |
|
# 解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 |
|
if (!-e \$request_filename) { |
|
rewrite ^(.*)\$ /index.html?s=\$1 last; |
|
break; |
|
} |
|
} |
|
|
|
location /api/ { |
|
proxy_pass PROD_API_URL; |
|
proxy_set_header Host $host:$server_port; |
|
proxy_set_header X-Real-IP $remote_addr; |
|
proxy_set_header X-Real-PORT $remote_port; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
} |
|
|
|
location /api/websocket/ { |
|
proxy_pass PROD_API_URL/websocket/; |
|
proxy_http_version 1.1; |
|
proxy_set_header Upgrade $http_upgrade; |
|
proxy_set_header Connection "Upgrade"; |
|
proxy_set_header X-real-ip $remote_addr; |
|
proxy_set_header X-Forwarded-For $remote_addr; |
|
} |
|
} |