45 lines
1.5 KiB
Nginx Configuration File
45 lines
1.5 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name cloudnest.example.com;
|
|
|
|
# 前端静态文件 / Frontend static files
|
|
location / {
|
|
# Auth Service 提供前端页面
|
|
# Auth Service serves frontend pages
|
|
proxy_pass http://localhost:8081;
|
|
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;
|
|
}
|
|
|
|
# 认证 API / Auth API
|
|
location /api/v1/auth/ {
|
|
proxy_pass http://localhost:8081;
|
|
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;
|
|
}
|
|
|
|
# 文件服务 API / File service API
|
|
location /api/v1/files/ {
|
|
proxy_pass http://localhost:8082;
|
|
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;
|
|
}
|
|
|
|
# 健康检查 / Health check
|
|
location /healthz {
|
|
proxy_pass http://localhost:8081;
|
|
access_log off;
|
|
}
|
|
|
|
# SSL/TLS 配置(生产环境)/ SSL/TLS configuration (production)
|
|
# ssl_certificate /etc/nginx/ssl/cloudnest.crt;
|
|
# ssl_certificate_key /etc/nginx/ssl/cloudnest.key;
|
|
# ssl_protocols TLSv1.2 TLSv1.3;
|
|
# ssl_ciphers HIGH:!aNULL:!MD5;
|
|
} |