nginx.conf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. alias /usr/share/nginx/html/chat;
  25. try_files $uri $uri/ /chat/index.html;
  26. }
  27. location /chat/api {
  28. proxy_pass http://maxkb-web:8080;
  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. proxy_set_header X-Forwarded-Proto $scheme;
  33. }
  34. location /ws {
  35. proxy_pass http://maxkb-web:8080;
  36. proxy_http_version 1.1;
  37. proxy_set_header Upgrade $http_upgrade;
  38. proxy_set_header Connection "upgrade";
  39. proxy_set_header Host $host;
  40. proxy_set_header X-Real-IP $remote_addr;
  41. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  42. }
  43. gzip on;
  44. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  45. }