nginx.conf 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include mime.types;
  7. default_type application/octet-stream;
  8. sendfile on;
  9. keepalive_timeout 65;
  10. gzip on;
  11. gzip_min_length 1k;
  12. gzip_buffers 16 64K;
  13. gzip_http_version 1.1;
  14. gzip_comp_level 5;
  15. gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  16. gzip_vary on;
  17. gzip_proxied expired no-cache no-store private auth;
  18. gzip_disable "MSIE [1-6]\.";
  19. server {
  20. listen 80;
  21. server_name localhost;
  22. charset utf-8;
  23. location / {
  24. root /usr/share/nginx/html;
  25. try_files $uri $uri/ /index.html;
  26. index index.html index.htm;
  27. }
  28. location /prod-api/hubs {
  29. proxy_pass http://adminNet:5050/hubs; #启用http长连接支持websocket
  30. proxy_http_version 1.1;
  31. proxy_set_header Upgrade $http_upgrade;
  32. proxy_set_header Connection "upgrade";
  33. }
  34. location /prod-api/ {
  35. proxy_set_header Host $http_host;
  36. proxy_set_header X-Real-IP $remote_addr;
  37. proxy_set_header REMOTE-HOST $remote_addr;
  38. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  39. proxy_pass http://adminNet:5050/;
  40. }
  41. error_page 500 502 503 504 /50x.html;
  42. location = /50x.html {
  43. root html;
  44. }
  45. }
  46. }