Spaces:
Sleeping
Sleeping
Update nginx.conf
Browse files- nginx.conf +0 -20
nginx.conf
CHANGED
|
@@ -4,39 +4,19 @@ server {
|
|
| 4 |
|
| 5 |
server_name _;
|
| 6 |
|
| 7 |
-
# ------------------------------------------------
|
| 8 |
-
# 1. Định tuyến cho GRADIO (URL Gốc / Trang chủ)
|
| 9 |
-
# ------------------------------------------------
|
| 10 |
-
|
| 11 |
location / {
|
| 12 |
-
# Đảm bảo Nginx cắt URL gốc và chuyển tiếp tới /
|
| 13 |
proxy_pass http://localhost:7860/;
|
| 14 |
-
|
| 15 |
-
# Cấu hình WebSockets
|
| 16 |
proxy_http_version 1.1;
|
| 17 |
proxy_set_header Upgrade $http_upgrade;
|
| 18 |
proxy_set_header Connection 'upgrade';
|
| 19 |
-
|
| 20 |
-
# Headers chuẩn (RẤT QUAN TRỌNG CHO HF SPACES)
|
| 21 |
proxy_set_header Host $host;
|
| 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; # Cần cho HF HTTPS
|
| 25 |
-
|
| 26 |
proxy_read_timeout 86400;
|
| 27 |
proxy_redirect off;
|
| 28 |
}
|
| 29 |
|
| 30 |
-
|
| 31 |
-
# ------------------------------------------------
|
| 32 |
-
# 2. Xử lý Chuyển hướng BẮT BUỘC và Định tuyến cho STREAMLIT
|
| 33 |
-
# ------------------------------------------------
|
| 34 |
-
|
| 35 |
-
# Buộc chuyển hướng /streamlit -> /streamlit/
|
| 36 |
-
location = /streamlit {
|
| 37 |
-
return 302 /streamlit/;
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
location /streamlit/ {
|
| 41 |
# KHÔNG DÙNG DẤU / Ở CUỐI TRONG proxy_pass
|
| 42 |
# Vì Streamlit đã được cấu hình baseUrlPath để tự xử lý đường dẫn con
|
|
|
|
| 4 |
|
| 5 |
server_name _;
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
location / {
|
|
|
|
| 8 |
proxy_pass http://localhost:7860/;
|
|
|
|
|
|
|
| 9 |
proxy_http_version 1.1;
|
| 10 |
proxy_set_header Upgrade $http_upgrade;
|
| 11 |
proxy_set_header Connection 'upgrade';
|
|
|
|
|
|
|
| 12 |
proxy_set_header Host $host;
|
| 13 |
proxy_set_header X-Real-IP $remote_addr;
|
| 14 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 15 |
proxy_set_header X-Forwarded-Proto $scheme; # Cần cho HF HTTPS
|
|
|
|
| 16 |
proxy_read_timeout 86400;
|
| 17 |
proxy_redirect off;
|
| 18 |
}
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
location /streamlit/ {
|
| 21 |
# KHÔNG DÙNG DẤU / Ở CUỐI TRONG proxy_pass
|
| 22 |
# Vì Streamlit đã được cấu hình baseUrlPath để tự xử lý đường dẫn con
|