智慧水务管理系统 - 精河县供水工程综合管理平台

nginx.conf 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. user nginx;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 1024;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  12. '$status $body_bytes_sent "$http_referer" '
  13. '"$http_user_agent" "$http_x_forwarded_for"';
  14. access_log /var/log/nginx/access.log main;
  15. sendfile on;
  16. tcp_nopush on;
  17. keepalive_timeout 65;
  18. types_hash_max_size 2048;
  19. server {
  20. listen 80;
  21. server_name localhost;
  22. root /usr/share/nginx/html;
  23. index index.html;
  24. location / {
  25. try_files $uri $uri/ /index.html;
  26. }
  27. location /api {
  28. proxy_pass http://wm-gateway:8081;
  29. proxy_set_header Host $host;
  30. proxy_set_header X-Real-IP $remote_addr;
  31. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  32. }
  33. location /ws {
  34. proxy_pass http://wm-gateway:8081;
  35. proxy_http_version 1.1;
  36. proxy_set_header Upgrade $http_upgrade;
  37. proxy_set_header Connection "upgrade";
  38. proxy_set_header Host $host;
  39. proxy_set_header X-Real-IP $remote_addr;
  40. }
  41. }
  42. }