nginx.conf 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #gzip on;
  20. gzip on;
  21. gzip_http_version 1.0;
  22. gzip_static on;
  23. gzip_min_length 1k;
  24. gzip_buffers 4 16k;
  25. #gzip_http_version 1.1;
  26. gzip_comp_level 5; # 压缩级别
  27. # 要压缩的mine类型
  28. 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;
  29. gzip_vary off;
  30. gzip_proxied expired no-cache no-store private auth;
  31. gzip_disable "MSIE [1-6]\."; # IE6不支持gzip
  32. upstream info_admin {
  33. server 172.17.0.1:30101;
  34. }
  35. upstream big_screen {
  36. server 172.17.0.1:30301;
  37. }
  38. server{
  39. listen 80;
  40. listen [::]:80;
  41. server_name localhost;
  42. location /collection/ {
  43. proxy_pass http://info_admin/;
  44. }
  45. location /bigScreen/ {
  46. proxy_pass http://big_screen/;
  47. }
  48. location /infoAdmin/ {
  49. proxy_pass http://172.17.0.1:60001/;
  50. }
  51. location /vueScreen/ {
  52. proxy_pass http://172.17.0.1:60003/;
  53. }
  54. location / {
  55. root /usr/share/nginx/html;
  56. index index.html index.html;
  57. try_files $uri $uri /index.html;
  58. }
  59. }
  60. }