server { listen 80; server_name yuheng.yuxindazhineng.com; # 若使用 HTTPS,取消下面注释并挂载证书到 /etc/nginx/ssl/ # listen 443 ssl; # ssl_certificate /etc/nginx/ssl/fullchain.pem; # ssl_certificate_key /etc/nginx/ssl/privkey.pem; location /api/ { proxy_pass http://api:9527; proxy_http_version 1.1; 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; } location /admin/ { proxy_pass http://admin:80/admin/; proxy_http_version 1.1; 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; } location / { proxy_pass http://web:80/; proxy_http_version 1.1; 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; } }