zradmin.ini 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. server {
  2. #修改要监听的端口
  3. listen 8080;
  4. #修改要绑定的域名或IP地址
  5. server_name localhost;
  6. # charset koi8-r;
  7. access_log logs/logs.access.log main;
  8. # 后端接口 生产环境
  9. location /prod-api/ {
  10. proxy_pass http://localhost:8888/;
  11. # 后端的Web服务器可以通过X-Forwarded-For获取用户真实IP
  12. proxy_set_header Host $host;
  13. proxy_set_header X-Real-IP $remote_addr;
  14. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  15. # 如果请求被负载均衡的服务器返回类似500这样的,将继续请求下一台应用服务器,默认 对post,lock,patch的请求不进行重试,如果要设置在后面添加 non_idemponent
  16. # proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
  17. }
  18. # vue项目配置
  19. location / {
  20. #将xxxxx路径改成你的发布路径
  21. root html/zradmin_vue;
  22. index index.html;
  23. try_files $uri $uri/ /index.html;
  24. }
  25. error_page 404 /404.html;
  26. # redirect server error pages to the static page /50x.html
  27. error_page 500 502 503 504 /50x.html;
  28. location = /50x.html {
  29. root html;
  30. }
  31. }