Spaces:
Running
Running
Update nginx.conf
Browse files- nginx.conf +98 -1
nginx.conf
CHANGED
|
@@ -8,29 +8,126 @@ http {
|
|
| 8 |
|
| 9 |
server {
|
| 10 |
listen 7860;
|
|
|
|
|
|
|
| 11 |
root /usr/share/nginx/html;
|
| 12 |
index index.html;
|
|
|
|
| 13 |
client_max_body_size 50M;
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
location /api/ {
|
| 16 |
proxy_pass http://127.0.0.1:8000;
|
|
|
|
|
|
|
| 17 |
proxy_set_header Host $host;
|
| 18 |
proxy_set_header X-Real-IP $remote_addr;
|
| 19 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 20 |
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
| 21 |
proxy_read_timeout 300s;
|
| 22 |
proxy_connect_timeout 300s;
|
| 23 |
proxy_send_timeout 300s;
|
| 24 |
}
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
location /audio/ {
|
| 27 |
proxy_pass http://127.0.0.1:8000/audio/;
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
proxy_pass http://127.0.0.1:8000/health;
|
|
|
|
| 32 |
}
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
location / {
|
| 35 |
try_files $uri $uri/ /index.html;
|
| 36 |
}
|
|
|
|
| 8 |
|
| 9 |
server {
|
| 10 |
listen 7860;
|
| 11 |
+
server_name _;
|
| 12 |
+
|
| 13 |
root /usr/share/nginx/html;
|
| 14 |
index index.html;
|
| 15 |
+
|
| 16 |
client_max_body_size 50M;
|
| 17 |
|
| 18 |
+
# ==============================
|
| 19 |
+
# API ROUTES
|
| 20 |
+
# ==============================
|
| 21 |
+
|
| 22 |
location /api/ {
|
| 23 |
proxy_pass http://127.0.0.1:8000;
|
| 24 |
+
proxy_http_version 1.1;
|
| 25 |
+
|
| 26 |
proxy_set_header Host $host;
|
| 27 |
proxy_set_header X-Real-IP $remote_addr;
|
| 28 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 29 |
proxy_set_header X-Forwarded-Proto $scheme;
|
| 30 |
+
|
| 31 |
proxy_read_timeout 300s;
|
| 32 |
proxy_connect_timeout 300s;
|
| 33 |
proxy_send_timeout 300s;
|
| 34 |
}
|
| 35 |
|
| 36 |
+
# ==============================
|
| 37 |
+
# LEGACY BACKEND ROUTES
|
| 38 |
+
# ==============================
|
| 39 |
+
|
| 40 |
+
location = /chat {
|
| 41 |
+
proxy_pass http://127.0.0.1:8000/chat;
|
| 42 |
+
proxy_http_version 1.1;
|
| 43 |
+
proxy_set_header Host $host;
|
| 44 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 45 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 46 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 47 |
+
proxy_read_timeout 300s;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
location = /upload-document {
|
| 51 |
+
proxy_pass http://127.0.0.1:8000/upload-document;
|
| 52 |
+
proxy_http_version 1.1;
|
| 53 |
+
proxy_set_header Host $host;
|
| 54 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 55 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 56 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 57 |
+
proxy_read_timeout 300s;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
location = /generate-audio {
|
| 61 |
+
proxy_pass http://127.0.0.1:8000/generate-audio;
|
| 62 |
+
proxy_http_version 1.1;
|
| 63 |
+
proxy_set_header Host $host;
|
| 64 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 65 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 66 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 67 |
+
proxy_read_timeout 300s;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
location = /youtube-search {
|
| 71 |
+
proxy_pass http://127.0.0.1:8000/youtube-search;
|
| 72 |
+
proxy_http_version 1.1;
|
| 73 |
+
proxy_set_header Host $host;
|
| 74 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 75 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 76 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 77 |
+
proxy_read_timeout 300s;
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
location = /youtube-video-info {
|
| 81 |
+
proxy_pass http://127.0.0.1:8000/youtube-video-info;
|
| 82 |
+
proxy_http_version 1.1;
|
| 83 |
+
proxy_set_header Host $host;
|
| 84 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 85 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 86 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 87 |
+
proxy_read_timeout 300s;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
location = /youtube-summary {
|
| 91 |
+
proxy_pass http://127.0.0.1:8000/youtube-summary;
|
| 92 |
+
proxy_http_version 1.1;
|
| 93 |
+
proxy_set_header Host $host;
|
| 94 |
+
proxy_set_header X-Real-IP $remote_addr;
|
| 95 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 96 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
| 97 |
+
proxy_read_timeout 300s;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
# ==============================
|
| 101 |
+
# AUDIO FILES
|
| 102 |
+
# ==============================
|
| 103 |
+
|
| 104 |
location /audio/ {
|
| 105 |
proxy_pass http://127.0.0.1:8000/audio/;
|
| 106 |
+
proxy_set_header Host $host;
|
| 107 |
}
|
| 108 |
|
| 109 |
+
# ==============================
|
| 110 |
+
# HEALTH
|
| 111 |
+
# ==============================
|
| 112 |
+
|
| 113 |
+
location = /health {
|
| 114 |
proxy_pass http://127.0.0.1:8000/health;
|
| 115 |
+
proxy_set_header Host $host;
|
| 116 |
}
|
| 117 |
|
| 118 |
+
# ==============================
|
| 119 |
+
# MODELS
|
| 120 |
+
# ==============================
|
| 121 |
+
|
| 122 |
+
location = /models {
|
| 123 |
+
proxy_pass http://127.0.0.1:8000/models;
|
| 124 |
+
proxy_set_header Host $host;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
# ==============================
|
| 128 |
+
# FRONTEND
|
| 129 |
+
# ==============================
|
| 130 |
+
|
| 131 |
location / {
|
| 132 |
try_files $uri $uri/ /index.html;
|
| 133 |
}
|