nginx.conf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. root /usr/share/nginx/html;
  5. index index.html;
  6. location / {
  7. try_files $uri $uri/ /index.html;
  8. }
  9. location /api {
  10. proxy_pass http://maxkb-web:8080;
  11. proxy_set_header Host $host;
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  14. proxy_set_header X-Forwarded-Proto $scheme;
  15. }
  16. location /admin {
  17. proxy_pass http://maxkb-web:8080;
  18. proxy_set_header Host $host;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header X-Forwarded-Proto $scheme;
  22. }
  23. location /chat {
  24. proxy_pass http://maxkb-web:8080;
  25. proxy_set_header Host $host;
  26. proxy_set_header X-Real-IP $remote_addr;
  27. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  28. proxy_set_header X-Forwarded-Proto $scheme;
  29. }
  30. location /ws {
  31. proxy_pass http://maxkb-web:8080;
  32. proxy_http_version 1.1;
  33. proxy_set_header Upgrade $http_upgrade;
  34. proxy_set_header Connection "upgrade";
  35. proxy_set_header Host $host;
  36. proxy_set_header X-Real-IP $remote_addr;
  37. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  38. }
  39. gzip on;
  40. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  41. }