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.
21 lines
616 B
21 lines
616 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; |
|
} |
|
} |