Spaces:
Running
Running
anyonehomep1mane commited on
Commit ·
e471cfa
1
Parent(s): 472efd1
Initial Changes
Browse files- nginx.conf +9 -5
nginx.conf
CHANGED
|
@@ -6,7 +6,6 @@ events {
|
|
| 6 |
|
| 7 |
http {
|
| 8 |
|
| 9 |
-
# Decide backend based on referer
|
| 10 |
map $http_referer $openapi_backend {
|
| 11 |
default "";
|
| 12 |
~*/auth/ http://127.0.0.1:8001;
|
|
@@ -16,24 +15,29 @@ http {
|
|
| 16 |
server {
|
| 17 |
listen 7860;
|
| 18 |
|
| 19 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
location /auth/ {
|
| 21 |
proxy_pass http://127.0.0.1:8001/;
|
| 22 |
proxy_set_header Host $host;
|
| 23 |
}
|
| 24 |
|
| 25 |
-
#
|
| 26 |
location /task/ {
|
| 27 |
proxy_pass http://127.0.0.1:8002/;
|
| 28 |
proxy_set_header Host $host;
|
| 29 |
}
|
| 30 |
|
| 31 |
-
#
|
| 32 |
location = /openapi.json {
|
| 33 |
proxy_pass $openapi_backend/openapi.json;
|
| 34 |
}
|
| 35 |
|
| 36 |
-
#
|
| 37 |
location = /favicon.ico {
|
| 38 |
return 204;
|
| 39 |
access_log off;
|
|
|
|
| 6 |
|
| 7 |
http {
|
| 8 |
|
|
|
|
| 9 |
map $http_referer $openapi_backend {
|
| 10 |
default "";
|
| 11 |
~*/auth/ http://127.0.0.1:8001;
|
|
|
|
| 15 |
server {
|
| 16 |
listen 7860;
|
| 17 |
|
| 18 |
+
# Root entry (HF Space landing)
|
| 19 |
+
location = / {
|
| 20 |
+
return 302 /auth/docs;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
# Auth service
|
| 24 |
location /auth/ {
|
| 25 |
proxy_pass http://127.0.0.1:8001/;
|
| 26 |
proxy_set_header Host $host;
|
| 27 |
}
|
| 28 |
|
| 29 |
+
# Task service
|
| 30 |
location /task/ {
|
| 31 |
proxy_pass http://127.0.0.1:8002/;
|
| 32 |
proxy_set_header Host $host;
|
| 33 |
}
|
| 34 |
|
| 35 |
+
# Swagger OpenAPI fix
|
| 36 |
location = /openapi.json {
|
| 37 |
proxy_pass $openapi_backend/openapi.json;
|
| 38 |
}
|
| 39 |
|
| 40 |
+
# Favicon
|
| 41 |
location = /favicon.ico {
|
| 42 |
return 204;
|
| 43 |
access_log off;
|