Spaces:
Running
Running
Hermes Agent commited on
Commit ·
ea12ce5
1
Parent(s): da6ef46
Fix Nginx subpath routing, API proxies, and WebSocket headers for all webapps
Browse files- nginx.conf +79 -3
nginx.conf
CHANGED
|
@@ -34,6 +34,11 @@ http {
|
|
| 34 |
# ----------------------------------------------------
|
| 35 |
location /openwebui/ {
|
| 36 |
proxy_pass http://127.0.0.1:8098/openwebui/;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
|
| 39 |
location = /openwebui {
|
|
@@ -42,6 +47,10 @@ http {
|
|
| 42 |
|
| 43 |
location /webui/ {
|
| 44 |
proxy_pass http://127.0.0.1:8098/openwebui/;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
location = /webui {
|
|
@@ -49,16 +58,22 @@ http {
|
|
| 49 |
}
|
| 50 |
|
| 51 |
# ----------------------------------------------------
|
| 52 |
-
# 2. OMNIROUTE GATEWAY (/omniroute, /v1)
|
| 53 |
# ----------------------------------------------------
|
| 54 |
location /omniroute/ {
|
| 55 |
proxy_pass http://127.0.0.1:20128/;
|
|
|
|
|
|
|
|
|
|
| 56 |
proxy_redirect /login /omniroute/login;
|
| 57 |
proxy_redirect /dashboard /omniroute/dashboard;
|
| 58 |
proxy_set_header Accept-Encoding "";
|
|
|
|
| 59 |
sub_filter 'href="/' 'href="/omniroute/';
|
| 60 |
sub_filter 'src="/' 'src="/omniroute/';
|
| 61 |
sub_filter 'action="/' 'action="/omniroute/';
|
|
|
|
|
|
|
| 62 |
sub_filter_once off;
|
| 63 |
}
|
| 64 |
|
|
@@ -66,39 +81,89 @@ http {
|
|
| 66 |
return 301 /omniroute/;
|
| 67 |
}
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
location /v1/ {
|
| 70 |
proxy_pass http://127.0.0.1:20128/v1/;
|
|
|
|
| 71 |
}
|
| 72 |
|
| 73 |
# ----------------------------------------------------
|
| 74 |
-
# 3. OPENCODE SERVER (/server, /session, /project, /
|
| 75 |
# ----------------------------------------------------
|
| 76 |
location /server/ {
|
| 77 |
proxy_pass http://127.0.0.1:4097/;
|
|
|
|
|
|
|
|
|
|
| 78 |
}
|
| 79 |
|
| 80 |
location = /server {
|
| 81 |
return 301 /server/;
|
| 82 |
}
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
location /session {
|
| 85 |
proxy_pass http://127.0.0.1:4097;
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
location /project {
|
| 89 |
proxy_pass http://127.0.0.1:4097;
|
|
|
|
| 90 |
}
|
| 91 |
|
| 92 |
location /config {
|
| 93 |
proxy_pass http://127.0.0.1:4097;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
}
|
| 95 |
|
| 96 |
location /events {
|
| 97 |
proxy_pass http://127.0.0.1:4097;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
}
|
| 99 |
|
| 100 |
location /ws {
|
| 101 |
proxy_pass http://127.0.0.1:4097;
|
|
|
|
|
|
|
|
|
|
| 102 |
}
|
| 103 |
|
| 104 |
# ----------------------------------------------------
|
|
@@ -106,6 +171,11 @@ http {
|
|
| 106 |
# ----------------------------------------------------
|
| 107 |
location /jellyfin/ {
|
| 108 |
proxy_pass http://127.0.0.1:8096/;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
| 110 |
|
| 111 |
location = /jellyfin {
|
|
@@ -114,10 +184,14 @@ http {
|
|
| 114 |
|
| 115 |
location /Jellyfin/ {
|
| 116 |
proxy_pass http://127.0.0.1:8096/;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
}
|
| 118 |
|
| 119 |
location = /Jellyfin {
|
| 120 |
-
return 301 /
|
| 121 |
}
|
| 122 |
|
| 123 |
# ----------------------------------------------------
|
|
@@ -125,6 +199,8 @@ http {
|
|
| 125 |
# ----------------------------------------------------
|
| 126 |
location /tg-stream/ {
|
| 127 |
proxy_pass http://127.0.0.1:8080/;
|
|
|
|
|
|
|
| 128 |
}
|
| 129 |
|
| 130 |
# ----------------------------------------------------
|
|
|
|
| 34 |
# ----------------------------------------------------
|
| 35 |
location /openwebui/ {
|
| 36 |
proxy_pass http://127.0.0.1:8098/openwebui/;
|
| 37 |
+
proxy_http_version 1.1;
|
| 38 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 39 |
+
proxy_set_header Connection "upgrade";
|
| 40 |
+
proxy_set_header Host $host;
|
| 41 |
+
proxy_set_header X-Forwarded-Prefix /openwebui;
|
| 42 |
}
|
| 43 |
|
| 44 |
location = /openwebui {
|
|
|
|
| 47 |
|
| 48 |
location /webui/ {
|
| 49 |
proxy_pass http://127.0.0.1:8098/openwebui/;
|
| 50 |
+
proxy_http_version 1.1;
|
| 51 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 52 |
+
proxy_set_header Connection "upgrade";
|
| 53 |
+
proxy_set_header Host $host;
|
| 54 |
}
|
| 55 |
|
| 56 |
location = /webui {
|
|
|
|
| 58 |
}
|
| 59 |
|
| 60 |
# ----------------------------------------------------
|
| 61 |
+
# 2. OMNIROUTE GATEWAY (/omniroute, /v1, /_next)
|
| 62 |
# ----------------------------------------------------
|
| 63 |
location /omniroute/ {
|
| 64 |
proxy_pass http://127.0.0.1:20128/;
|
| 65 |
+
proxy_http_version 1.1;
|
| 66 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 67 |
+
proxy_set_header Connection "upgrade";
|
| 68 |
proxy_redirect /login /omniroute/login;
|
| 69 |
proxy_redirect /dashboard /omniroute/dashboard;
|
| 70 |
proxy_set_header Accept-Encoding "";
|
| 71 |
+
sub_filter_types text/html text/javascript application/javascript application/json;
|
| 72 |
sub_filter 'href="/' 'href="/omniroute/';
|
| 73 |
sub_filter 'src="/' 'src="/omniroute/';
|
| 74 |
sub_filter 'action="/' 'action="/omniroute/';
|
| 75 |
+
sub_filter '="/_next/' '="/omniroute/_next/';
|
| 76 |
+
sub_filter '"/_next/' '"/omniroute/_next/';
|
| 77 |
sub_filter_once off;
|
| 78 |
}
|
| 79 |
|
|
|
|
| 81 |
return 301 /omniroute/;
|
| 82 |
}
|
| 83 |
|
| 84 |
+
location /_next/ {
|
| 85 |
+
proxy_pass http://127.0.0.1:20128/_next/;
|
| 86 |
+
proxy_http_version 1.1;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
location /v1/ {
|
| 90 |
proxy_pass http://127.0.0.1:20128/v1/;
|
| 91 |
+
proxy_http_version 1.1;
|
| 92 |
}
|
| 93 |
|
| 94 |
# ----------------------------------------------------
|
| 95 |
+
# 3. OPENCODE SERVER (/server, /api, /session, /project, /config, etc.)
|
| 96 |
# ----------------------------------------------------
|
| 97 |
location /server/ {
|
| 98 |
proxy_pass http://127.0.0.1:4097/;
|
| 99 |
+
proxy_http_version 1.1;
|
| 100 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 101 |
+
proxy_set_header Connection "upgrade";
|
| 102 |
}
|
| 103 |
|
| 104 |
location = /server {
|
| 105 |
return 301 /server/;
|
| 106 |
}
|
| 107 |
|
| 108 |
+
location /api/ {
|
| 109 |
+
proxy_pass http://127.0.0.1:4097/api/;
|
| 110 |
+
proxy_http_version 1.1;
|
| 111 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 112 |
+
proxy_set_header Connection "upgrade";
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
location /session {
|
| 116 |
proxy_pass http://127.0.0.1:4097;
|
| 117 |
+
proxy_http_version 1.1;
|
| 118 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 119 |
+
proxy_set_header Connection "upgrade";
|
| 120 |
}
|
| 121 |
|
| 122 |
location /project {
|
| 123 |
proxy_pass http://127.0.0.1:4097;
|
| 124 |
+
proxy_http_version 1.1;
|
| 125 |
}
|
| 126 |
|
| 127 |
location /config {
|
| 128 |
proxy_pass http://127.0.0.1:4097;
|
| 129 |
+
proxy_http_version 1.1;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
location /permission {
|
| 133 |
+
proxy_pass http://127.0.0.1:4097;
|
| 134 |
+
proxy_http_version 1.1;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
location /question {
|
| 138 |
+
proxy_pass http://127.0.0.1:4097;
|
| 139 |
+
proxy_http_version 1.1;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
location /file {
|
| 143 |
+
proxy_pass http://127.0.0.1:4097;
|
| 144 |
+
proxy_http_version 1.1;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
location /find {
|
| 148 |
+
proxy_pass http://127.0.0.1:4097;
|
| 149 |
+
proxy_http_version 1.1;
|
| 150 |
}
|
| 151 |
|
| 152 |
location /events {
|
| 153 |
proxy_pass http://127.0.0.1:4097;
|
| 154 |
+
proxy_http_version 1.1;
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
location /event {
|
| 158 |
+
proxy_pass http://127.0.0.1:4097;
|
| 159 |
+
proxy_http_version 1.1;
|
| 160 |
}
|
| 161 |
|
| 162 |
location /ws {
|
| 163 |
proxy_pass http://127.0.0.1:4097;
|
| 164 |
+
proxy_http_version 1.1;
|
| 165 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 166 |
+
proxy_set_header Connection "upgrade";
|
| 167 |
}
|
| 168 |
|
| 169 |
# ----------------------------------------------------
|
|
|
|
| 171 |
# ----------------------------------------------------
|
| 172 |
location /jellyfin/ {
|
| 173 |
proxy_pass http://127.0.0.1:8096/;
|
| 174 |
+
proxy_http_version 1.1;
|
| 175 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 176 |
+
proxy_set_header Connection "upgrade";
|
| 177 |
+
proxy_set_header Host $host;
|
| 178 |
+
proxy_set_header X-Forwarded-Prefix /jellyfin;
|
| 179 |
}
|
| 180 |
|
| 181 |
location = /jellyfin {
|
|
|
|
| 184 |
|
| 185 |
location /Jellyfin/ {
|
| 186 |
proxy_pass http://127.0.0.1:8096/;
|
| 187 |
+
proxy_http_version 1.1;
|
| 188 |
+
proxy_set_header Upgrade $http_upgrade;
|
| 189 |
+
proxy_set_header Connection "upgrade";
|
| 190 |
+
proxy_set_header Host $host;
|
| 191 |
}
|
| 192 |
|
| 193 |
location = /Jellyfin {
|
| 194 |
+
return 301 /jellyfin/;
|
| 195 |
}
|
| 196 |
|
| 197 |
# ----------------------------------------------------
|
|
|
|
| 199 |
# ----------------------------------------------------
|
| 200 |
location /tg-stream/ {
|
| 201 |
proxy_pass http://127.0.0.1:8080/;
|
| 202 |
+
proxy_http_version 1.1;
|
| 203 |
+
proxy_buffering off;
|
| 204 |
}
|
| 205 |
|
| 206 |
# ----------------------------------------------------
|