ishaq101 Claude Sonnet 4.6 (1M context) commited on
Commit
8d02c8d
·
1 Parent(s): aa18923

fix: add nginx resolver and proxy_ssl_server_name for external HTTPS proxy

Browse files

nginx requires an explicit resolver when proxy_pass uses a variable.
Also enable proxy_ssl_server_name so TLS SNI works correctly when
proxying to the HTTPS backend on HuggingFace Spaces.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -23,9 +23,12 @@ RUN printf 'server {\n\
23
  index index.html;\n\
24
  \n\
25
  location /api/ {\n\
26
- proxy_pass ${VITE_API_BASE_URL}/api/;\n\
27
- proxy_set_header Host $http_host;\n\
 
 
28
  proxy_set_header X-Real-IP $remote_addr;\n\
 
29
  }\n\
30
  \n\
31
  location / {\n\
 
23
  index index.html;\n\
24
  \n\
25
  location /api/ {\n\
26
+ resolver 8.8.8.8 valid=30s;\n\
27
+ set $backend ${VITE_API_BASE_URL};\n\
28
+ proxy_pass $backend/api/;\n\
29
+ proxy_set_header Host $proxy_host;\n\
30
  proxy_set_header X-Real-IP $remote_addr;\n\
31
+ proxy_ssl_server_name on;\n\
32
  }\n\
33
  \n\
34
  location / {\n\