nginx.conf 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. user nginx;
  2. worker_processes auto;
  3. worker_rlimit_nofile 65535;
  4. error_log /var/log/nginx/error.log notice;
  5. pid /var/run/nginx.pid;
  6. events {
  7. worker_connections 65535;
  8. }
  9. http {
  10. include /etc/nginx/mime.types;
  11. default_type application/octet-stream;
  12. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  13. '$status $body_bytes_sent "$http_referer" '
  14. '"$http_user_agent" "$http_x_forwarded_for"';
  15. access_log /var/log/nginx/access.log main;
  16. sendfile on;
  17. #tcp_nopush on;
  18. keepalive_timeout 65;
  19. client_max_body_size 15m;
  20. server{
  21. listen 80;
  22. listen [::]:80;
  23. server_name localhost;
  24. location /prod-api/ {
  25. proxy_pass http://172.17.0.1:5050/;
  26. }
  27. location /uploadPath/ {
  28. proxy_pass http://172.17.0.1:5050/file/uploadPath/;
  29. }
  30. location /mzylfwobs/ {
  31. proxy_pass http://172.17.0.1:5050/file/mzylfwobs/;
  32. }
  33. location /getxflrinfo {
  34. proxy_pass http://121.36.73.159:8090/getxflrinfo;
  35. }
  36. location /getxflrdata {
  37. proxy_pass http://121.36.73.159:8090/getxflrdata;
  38. }
  39. location / {
  40. root /usr/share/nginx/html;
  41. index index.html index.html;
  42. try_files $uri $uri /index.html;
  43. }
  44. location /jmgc {
  45. root /usr/share/nginx/html;
  46. try_files $uri $uri/ /jmgc/index.html;
  47. index index.html index.htm;
  48. }
  49. }
  50. gzip on;
  51. gzip_http_version 1.0;
  52. gzip_static on;
  53. gzip_min_length 1k;
  54. gzip_buffers 4 16k;
  55. #gzip_http_version 1.1;
  56. gzip_comp_level 5; # 压缩级别
  57. # 要压缩的mine类型
  58. gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss image/jpeg image/gif image/png image/svg+xml;
  59. gzip_vary off;
  60. gzip_proxied expired no-cache no-store private auth;
  61. gzip_disable "MSIE [1-6]\."; # IE6不支持gzip
  62. }