nginx.conf 957 B

123456789101112131415161718192021222324252627282930313233343536
  1. # nginx.conf - adminui 总后台(fs-nginx-admin)
  2. # 与 vue.config.js 一致:全部 /prod-api/* → fs-admin:8003
  3. worker_processes 5;
  4. events {
  5. worker_connections 1024;
  6. }
  7. http {
  8. include mime.types;
  9. default_type application/octet-stream;
  10. client_max_body_size 200m;
  11. sendfile on;
  12. keepalive_timeout 65;
  13. server {
  14. listen 80;
  15. server_name localhost;
  16. root /usr/share/nginx/html;
  17. index index.html;
  18. location / {
  19. try_files $uri $uri/ /index.html;
  20. }
  21. # 默认全部 API → fs-admin(内网 192.168.58.159:8003)
  22. location /prod-api/ {
  23. proxy_pass http://192.168.58.159:8003/;
  24. proxy_set_header Host $host;
  25. proxy_set_header X-Real-IP $remote_addr;
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. proxy_set_header X-Forwarded-Proto $scheme;
  28. }
  29. }
  30. }