boot.conf 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. server {
  2. listen 10000;
  3. server_name localhost;
  4. underscores_in_headers on;
  5. # 切记, 在docker启动的nginx 必须将该文件中所有的 localhost 改成服务器的 内网ip (不能为 127.0.0.1)
  6. # boot版本跟cloud 版本的区别在此, 8764为 zuihou-authority-server 项目启动的端口
  7. location /api/authority/ {
  8. proxy_pass http://192.168.1.34:8764/;
  9. }
  10. location /api/file/ {
  11. proxy_pass http://192.168.1.34:8764/;
  12. }
  13. location /api/msgs/ {
  14. proxy_pass http://192.168.1.34:8764/;
  15. }
  16. location /api/gate/{
  17. proxy_pass http://localhost:8764/;
  18. }
  19. location /zuihou-ui {
  20. proxy_set_header Host $host:$server_port;
  21. proxy_redirect off;
  22. proxy_set_header X-Real-IP $remote_addr;
  23. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  24. proxy_connect_timeout 60;
  25. proxy_read_timeout 600;
  26. proxy_send_timeout 600;
  27. root /data/projects/;
  28. index index.html;
  29. }
  30. # 文件跨域
  31. location /crossdomain.xml {
  32. alias /usr/local/nginx/html/crossdomain.xml;
  33. }
  34. # 文件访问配置
  35. location ^~ /file {
  36. if ($request_uri ~* ^.*\/(.*)\.(apk|java|txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx|jpg|png)(\?fileName=([^&]+))$) {
  37. add_header Content-Disposition "attachment;filename=$arg_attname";
  38. }
  39. root /data/projects/uploadfile;
  40. index index.html;
  41. }
  42. }
  43. server {
  44. listen 180;
  45. server_name localhost;
  46. underscores_in_headers on;
  47. location /zuihou-admin-ui {
  48. proxy_set_header Host $host:$server_port;
  49. proxy_redirect off;
  50. proxy_set_header X-Real-IP $remote_addr;
  51. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  52. proxy_connect_timeout 60;
  53. proxy_read_timeout 600;
  54. proxy_send_timeout 600;
  55. root /data/projects/;
  56. index index.html;
  57. }
  58. }