default.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. root /wwwroot/jnpfsoft/jnpf-web;
  5. index index.html;
  6. gzip on;
  7. gzip_static on;
  8. gzip_min_length 1k;
  9. gzip_comp_level 4;
  10. gzip_proxied any;
  11. gzip_types text/plain text/xml text/css;
  12. gzip_vary on;
  13. gzip_http_version 1.0;
  14. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  15. # JNPF-START
  16. # 设置上传文件的大小
  17. client_max_body_size 100m;
  18. # 添加头部信息
  19. proxy_set_header Host $http_host;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  22. proxy_set_header X-Forwarded-Proto $scheme;
  23. proxy_set_header X-NginX-Proxy true;
  24. # This is necessary to pass the correct IP to be hashed
  25. real_ip_header X-Real-IP;
  26. proxy_connect_timeout 300;
  27. location / {
  28. try_files $uri $uri/ /index.html;
  29. }
  30. location /DataV {
  31. try_files $uri $uri/ /DataV/index.html;
  32. }
  33. # 后端服务
  34. location /api/ {
  35. proxy_pass http://jnpf-gateway-external.java-cloud-v350:30000;
  36. }
  37. location /websocket {
  38. proxy_pass http://jnpf-gateway-external.java-cloud-v350:30000/api/message/websocket;
  39. proxy_http_version 1.1;
  40. proxy_set_header Upgrade $http_upgrade;
  41. proxy_set_header Connection "upgrade";
  42. proxy_read_timeout 600s;
  43. }
  44. # 报表
  45. location /ReportServer/ {
  46. proxy_pass http://jnpf-gateway-external.java-cloud-v350:30000/;
  47. }
  48. # 文件预览
  49. location /FileServer {
  50. proxy_pass http://jnpf-file-preview-external.java-cloud-v350:30090;
  51. }
  52. location ~ /FileServer/*.*\.(js|css)?$ {
  53. proxy_pass http://jnpf-file-preview-external.java-cloud-v350:30090;
  54. }
  55. }