29 lines
785 B
Nginx Configuration File
29 lines
785 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
# 前端静态文件路径
|
|
location /ashai-wecom-test {
|
|
alias /usr/share/nginx/html/ashai-wecom-test;
|
|
try_files $uri $uri/ /ashai-wecom-test/index.html;
|
|
index index.html;
|
|
}
|
|
|
|
# API 代理到后端
|
|
location /ashai-wecom-test/prod-api/ {
|
|
proxy_pass http://backend:8080/;
|
|
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 X-Forwarded-Proto $scheme;
|
|
proxy_connect_timeout 600;
|
|
proxy_read_timeout 600;
|
|
}
|
|
|
|
# 错误页面
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|