nginx.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. rewrite ^/admin(/.*)$ $1 break;
  18. proxy_pass http://maxkb-web:8080;
  19. proxy_set_header Host $host;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  22. proxy_set_header X-Forwarded-Proto $scheme;
  23. }
  24. location /chat {
  25. alias /usr/share/nginx/html/chat;
  26. try_files $uri $uri/ /chat/index.html;
  27. }
  28. location /chat/api {
  29. proxy_pass http://maxkb-web:8080;
  30. proxy_set_header Host $host;
  31. proxy_set_header X-Real-IP $remote_addr;
  32. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  33. proxy_set_header X-Forwarded-Proto $scheme;
  34. }
  35. location /ws {
  36. proxy_pass http://maxkb-web:8080;
  37. proxy_http_version 1.1;
  38. proxy_set_header Upgrade $http_upgrade;
  39. proxy_set_header Connection "upgrade";
  40. proxy_set_header Host $host;
  41. proxy_set_header X-Real-IP $remote_addr;
  42. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  43. }
  44. gzip on;
  45. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  46. }