nginx.conf 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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://19.135.92.130:8080/;
  26. }
  27. location /uploadPath/ {
  28. proxy_pass http://19.135.92.130:8080/file/uploadPath/;
  29. }
  30. location /mzylfwobs/ {
  31. proxy_pass http://19.135.92.130:8080/file/mzylfwobs/;
  32. }
  33. location / {
  34. root /usr/share/nginx/html;
  35. index index.html index.html;
  36. try_files $uri $uri /index.html;
  37. }
  38. location /portal {
  39. root /usr/share/nginx/html;
  40. index index.html index.html;
  41. try_files $uri $uri /portal/index.html;
  42. }
  43. }
  44. gzip on;
  45. gzip_http_version 1.0;
  46. gzip_static on;
  47. gzip_min_length 1k;
  48. gzip_buffers 4 16k;
  49. #gzip_http_version 1.1;
  50. gzip_comp_level 5; # 压缩级别
  51. # 要压缩的mine类型
  52. 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;
  53. gzip_vary off;
  54. gzip_proxied expired no-cache no-store private auth;
  55. gzip_disable "MSIE [1-6]\."; # IE6不支持gzip
  56. }