nginx.conf 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. events {
  2. worker_connections 1024;
  3. }
  4. http {
  5. include /etc/nginx/mime.types;
  6. default_type application/octet-stream;
  7. sendfile on;
  8. keepalive_timeout 65;
  9. client_max_body_size 200m;
  10. upstream backend {
  11. server ${BACKEND_HOST};
  12. }
  13. server {
  14. listen 80;
  15. root /usr/share/nginx/html;
  16. location / {
  17. try_files $uri $uri/ /index.html;
  18. }
  19. location /api/ {
  20. proxy_pass http://backend;
  21. proxy_set_header Host $host:$server_port;
  22. proxy_set_header X-Real-IP $remote_addr;
  23. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  24. proxy_set_header X-Forwarded-Proto $scheme;
  25. proxy_set_header X-Forwarded-Port $server_port;
  26. proxy_http_version 1.1;
  27. proxy_set_header Connection "";
  28. proxy_read_timeout 1200s;
  29. proxy_buffering off;
  30. }
  31. location /health {
  32. return 200 'ok';
  33. add_header Content-Type text/plain;
  34. }
  35. error_page 500 502 503 504 /50x.html;
  36. location = /50x.html {
  37. root /usr/share/nginx/html;
  38. }
  39. }
  40. }