nginx.conf 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 443 ssl;
  21. listen 80;
  22. server_name localhost;
  23. charset utf-8;
  24. ssl_certificate /etc/nginx/key/server.pem;
  25. ssl_certificate_key /etc/nginx/key/server.key;
  26. ssl_session_cache shared:SSL:1m;
  27. location / {
  28. root /usr/share/nginx/html;
  29. try_files $uri $uri/ /index.html;
  30. index index.html index.htm;
  31. }
  32. location /prod-api/hubs {
  33. proxy_pass http://adminNet:5050/hubs; #启用http长连接支持websocket
  34. proxy_http_version 1.1;
  35. proxy_set_header Upgrade $http_upgrade;
  36. proxy_set_header Connection "upgrade";
  37. }
  38. location /prod-api/ {
  39. proxy_set_header Host $http_host;
  40. proxy_set_header X-Real-IP $remote_addr;
  41. proxy_set_header REMOTE-HOST $remote_addr;
  42. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43. proxy_pass http://adminNet:5050/;
  44. }
  45. error_page 500 502 503 504 /50x.html;
  46. location = /50x.html {
  47. root html;
  48. }
  49. }
  50. }