kindergarten_java/reading-platform-frontend/nginx.conf

22 lines
439 B
Nginx Configuration File
Raw Permalink Normal View History

server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# Vue Router history 模式支持
location / {
try_files $uri $uri/ /index.html;
}
# 反向代理后端 API
location /api/ {
proxy_pass http://backend:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /uploads/ {
proxy_pass http://backend:8080;
}
}