nginx.conf 1.8 KB

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