Files
dreamweaver/admin-frontend/nginx.conf
torin b8d3cb4644
Some checks are pending
Build and Push Docker Images / changes (push) Waiting to run
Build and Push Docker Images / build-backend (push) Blocked by required conditions
Build and Push Docker Images / build-frontend (push) Blocked by required conditions
Build and Push Docker Images / build-admin-frontend (push) Blocked by required conditions
wip: snapshot full local workspace state
2026-04-17 18:58:11 +08:00

38 lines
1.1 KiB
Nginx Configuration File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server {
listen 80;
server_name localhost;
# 静态文件服务
location / {
root /usr/share/nginx/html;
index index.html index.htm;
# SPA 路由支持: 找不到文件时回退到 index.html
try_files $uri $uri/ /index.html;
}
# 反向代理: 将 /admin 请求转发给管理后端
location /admin/ {
proxy_pass http://backend-admin:8001/admin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 仍保留 /api 以备偶尔调用通用接口Auth等
location /api/ {
proxy_pass http://backend-admin:8001/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# 静态资源代理
location /static/ {
proxy_pass http://backend-admin:8001/static/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}