jw项目windows环境软件安装
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.2 KiB

1 year ago
  1. #user nobody;
  2. worker_processes 1;
  3. #error_log logs/error.log;
  4. #error_log logs/error.log notice;
  5. #error_log logs/error.log info;
  6. #pid logs/nginx.pid;
  7. events {
  8. worker_connections 1024;
  9. }
  10. http {
  11. include mime.types;
  12. default_type application/octet-stream;
  13. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  14. # '$status $body_bytes_sent "$http_referer" '
  15. # '"$http_user_agent" "$http_x_forwarded_for"';
  16. #access_log logs/access.log main;
  17. add_header Content-Security-Policy "upgrade-insecure-requests";
  18. sendfile on;
  19. #tcp_nopush on;
  20. #keepalive_timeout 0;
  21. keepalive_timeout 65s;
  22. client_max_body_size 500m; # 设置客户端请求的最大大小
  23. client_body_buffer_size 500m; # 设置客户端请求的缓冲区大小
  24. proxy_read_timeout 7200s; # 设置代理服务器读取客户端请求的超时时间
  25. gzip on; # 开启gzip压缩
  26. gzip_vary on; # 根据请求头中的Accept-Encoding启用Vary响应头
  27. gzip_proxied any; # 无论请求是否已经压缩,都进行压缩
  28. gzip_comp_level 5; # 压缩级别,1-9,9最快但消耗更多CPU资源
  29. gzip_min_length 256; # 只压缩大于256字节的响应
  30. gzip_types text/plain text/css text/xml application/json application/javascript application/x-javascript; # 压缩的MIME类型
  31. gzip_disable "MSIE6"; # 针对IE6禁用gzip
  32. server {
  33. listen 3831;
  34. server_name 127.0.0.1;
  35. # 跨域配置 start
  36. add_header Access-Control-Allow-Origin *;
  37. add_header Cache-Control "no-cache, no-store";
  38. # 限制外网访问内网 actuator 相关路径
  39. location ~ ^(/[^/]*)?/actuator(/.*)?$ {
  40. return 403;
  41. }
  42. location / {
  43. root ./path/analysis-system; # 相对于nginx安装目录的相对路径
  44. index index.html index.htm;
  45. try_files $uri $uri/ /index.html;
  46. }
  47. location /prod-api/ {
  48. proxy_set_header Host $http_host;
  49. proxy_set_header X-Real-IP $remote_addr;
  50. proxy_set_header REMOTE-HOST $remote_addr;
  51. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  52. proxy_pass http://127.0.0.1:8089/;
  53. }
  54. error_page 500 502 503 504 /50x.html;
  55. location = /50x.html {
  56. root html;
  57. }
  58. }
  59. # another virtual host using mix of IP-, name-, and port-based configuration
  60. #
  61. #server {
  62. # listen 8000;
  63. # listen somename:8080;
  64. # server_name somename alias another.alias;
  65. # location / {
  66. # root html;
  67. # index index.html index.htm;
  68. # }
  69. #}
  70. # HTTPS server
  71. #
  72. #server {
  73. # listen 443 ssl;
  74. # server_name localhost;
  75. # ssl_certificate cert.pem;
  76. # ssl_certificate_key cert.key;
  77. # ssl_session_cache shared:SSL:1m;
  78. # ssl_session_timeout 5m;
  79. # ssl_ciphers HIGH:!aNULL:!MD5;
  80. # ssl_prefer_server_ciphers on;
  81. # location / {
  82. # root html;
  83. # index index.html index.htm;
  84. # }
  85. #}
  86. }