nginx.conf 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 120;
  19. # 设置连接超时时间为30秒
  20. fastcgi_connect_timeout 120s;
  21. # 设置请求超时时间为60秒
  22. fastcgi_send_timeout 120s;
  23. fastcgi_read_timeout 120s;
  24. proxy_send_timeout 120s;
  25. proxy_read_timeout 120s;
  26. client_body_timeout 120s;
  27. client_header_timeout 120s;
  28. send_timeout 120;
  29. #gzip on;
  30. gzip on;
  31. gzip_http_version 1.0;
  32. gzip_static on;
  33. gzip_min_length 1k;
  34. gzip_buffers 4 16k;
  35. #gzip_http_version 1.1;
  36. gzip_comp_level 5; # 压缩级别
  37. # 要压缩的mine类型
  38. 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;
  39. gzip_vary off;
  40. gzip_proxied expired no-cache no-store private auth;
  41. gzip_disable "MSIE [1-6]\."; # IE6不支持gzip
  42. upstream info_admin {
  43. server 10.201.146.3:7001;
  44. }
  45. upstream big_screen {
  46. server 10.201.146.3:7002;
  47. }
  48. server{
  49. listen 80;
  50. listen [::]:80;
  51. server_name localhost;
  52. location /collection/ {
  53. proxy_pass http://info_admin/;
  54. }
  55. location /bigScreen/ {
  56. proxy_pass http://big_screen/;
  57. }
  58. location /infoAdmin/ {
  59. proxy_pass http://10.201.146.3:8091/;
  60. }
  61. location /infoVue/ {
  62. proxy_pass http://10.201.146.3:8092/;
  63. }
  64. location /vueScreen/ {
  65. proxy_pass http://10.201.146.3:8093/;
  66. }
  67. location / {
  68. root /usr/share/nginx/html;
  69. index index.html index.html;
  70. try_files $uri $uri /index.html;
  71. }
  72. }
  73. }