2
0

default.nginx.conf.template 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. gzip_static on;
  2. gzip on;
  3. gzip_min_length 50000;
  4. gzip_proxied expired no-cache no-store private auth;
  5. gzip_types
  6. application/atom+xml
  7. application/geo+json
  8. application/javascript
  9. application/x-javascript
  10. application/json
  11. application/ld+json
  12. application/manifest+json
  13. application/rdf+xml
  14. application/rss+xml
  15. application/vnd.ms-fontobject
  16. application/wasm
  17. application/x-web-app-manifest+json
  18. application/xhtml+xml
  19. application/xml
  20. font/eot
  21. font/otf
  22. font/ttf
  23. image/bmp
  24. image/svg+xml
  25. text/cache-manifest
  26. text/calendar
  27. text/css
  28. text/javascript
  29. text/markdown
  30. text/plain
  31. text/xml
  32. text/x-component
  33. text/x-cross-domain-policy;
  34. upstream model {
  35. # Update to the cost model endpoint
  36. # Example: host.docker.internal:9003;
  37. server ${API_SERVER}:${API_PORT};
  38. }
  39. server {
  40. server_name _;
  41. root /var/www;
  42. index index.html;
  43. large_client_header_buffers 4 32k;
  44. add_header Cache-Control "must-revalidate";
  45. error_page 504 /custom_504.html;
  46. location = /custom_504.html {
  47. internal;
  48. }
  49. add_header Cache-Control "max-age=300";
  50. location / {
  51. root /var/www;
  52. index index.html index.htm;
  53. try_files $uri /index.html;
  54. }
  55. add_header ETag "1.96.0";
  56. listen ${UI_PORT};
  57. listen [::]:${UI_PORT};
  58. resolver 127.0.0.1 valid=5s;
  59. location /healthz {
  60. access_log /dev/null;
  61. return 200 'OK';
  62. }
  63. location /model/ {
  64. proxy_connect_timeout 180;
  65. proxy_send_timeout 180;
  66. proxy_read_timeout 180;
  67. proxy_pass http://model/;
  68. proxy_redirect off;
  69. proxy_http_version 1.1;
  70. proxy_set_header Connection "";
  71. proxy_set_header X-Real-IP $remote_addr;
  72. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  73. }
  74. }