Spaces:
Running
Running
fix: add nginx resolver and proxy_ssl_server_name for external HTTPS proxy
Browse filesnginx 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>
- 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 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 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\
|