Hermes Agent commited on
Commit
bbd3e04
·
1 Parent(s): b4b7881

Map OmniRoute /login, /dashboard, and /models SPA routes to port 20128

Browse files
Files changed (1) hide show
  1. nginx.conf +30 -65
nginx.conf CHANGED
@@ -30,92 +30,57 @@ http {
30
  proxy_redirect ~^http://jishnupg-opencode-cli\.hf\.space/(.*)$ https://jishnupg-opencode-cli.hf.space/$1;
31
 
32
  # ----------------------------------------------------
33
- # 1. OPEN WEBUI (/openwebui and /webui)
34
- # ----------------------------------------------------
35
- location /openwebui/ {
36
- proxy_pass http://127.0.0.1:8098/;
37
- }
38
-
39
- location = /openwebui {
40
- return 301 /openwebui/;
41
- }
42
-
43
- location /webui/ {
44
- proxy_pass http://127.0.0.1:8098/;
45
- }
46
-
47
- location = /webui {
48
- return 301 /webui/;
49
- }
50
-
51
- # ----------------------------------------------------
52
- # 2. OMNIROUTE GATEWAY (/omniroute, /login, /dashboard, and /v1)
53
  # ----------------------------------------------------
54
  location /omniroute/ {
55
  proxy_pass http://127.0.0.1:20128/;
56
- proxy_redirect /login https://jishnupg-opencode-cli.hf.space/omniroute/login;
57
- proxy_redirect /dashboard https://jishnupg-opencode-cli.hf.space/omniroute/dashboard;
58
- proxy_redirect ~^https?://[^/]+(?::\d+)?/login(.*)$ https://jishnupg-opencode-cli.hf.space/omniroute/login$1;
59
- proxy_redirect ~^https?://[^/]+(?::\d+)?/dashboard(.*)$ https://jishnupg-opencode-cli.hf.space/omniroute/dashboard$1;
60
- proxy_set_header Accept-Encoding "";
61
- sub_filter 'href="/' 'href="/omniroute/';
62
- sub_filter 'src="/' 'src="/omniroute/';
63
- sub_filter 'action="/' 'action="/omniroute/';
64
- sub_filter '="/login' '="/omniroute/login';
65
- sub_filter '="/dashboard' '="/omniroute/dashboard';
66
- sub_filter_once off;
67
  }
68
 
69
  location = /omniroute {
70
  return 301 /omniroute/;
71
  }
72
 
73
- location /omniroute/login {
74
  proxy_pass http://127.0.0.1:20128/login;
75
- proxy_redirect /login https://jishnupg-opencode-cli.hf.space/omniroute/login;
76
- proxy_redirect /dashboard https://jishnupg-opencode-cli.hf.space/omniroute/dashboard;
77
- proxy_set_header Accept-Encoding "";
78
- sub_filter 'href="/' 'href="/omniroute/';
79
- sub_filter 'src="/' 'src="/omniroute/';
80
- sub_filter 'action="/' 'action="/omniroute/';
81
- sub_filter '="/login' '="/omniroute/login';
82
- sub_filter '="/dashboard' '="/omniroute/dashboard';
83
- sub_filter_once off;
84
- }
85
-
86
- location /omniroute/dashboard {
87
  proxy_pass http://127.0.0.1:20128/dashboard;
88
- proxy_set_header Accept-Encoding "";
89
- sub_filter 'href="/' 'href="/omniroute/';
90
- sub_filter 'src="/' 'src="/omniroute/';
91
- sub_filter 'action="/' 'action="/omniroute/';
92
- sub_filter_once off;
93
  }
94
 
95
  location /omniroute/assets/ {
96
  proxy_pass http://127.0.0.1:20128/assets/;
97
  }
98
 
99
- # Handle root-level /login fallback for OmniRoute
100
- location /login {
101
- proxy_pass http://127.0.0.1:20128/login;
102
- proxy_set_header Accept-Encoding "";
103
- sub_filter 'href="/' 'href="/omniroute/';
104
- sub_filter 'src="/' 'src="/omniroute/';
105
- sub_filter 'action="/' 'action="/omniroute/';
106
- sub_filter_once off;
107
  }
108
 
109
- location /dashboard {
110
- proxy_pass http://127.0.0.1:20128/dashboard;
111
- proxy_set_header Accept-Encoding "";
112
- sub_filter 'href="/' 'href="/omniroute/';
113
- sub_filter 'src="/' 'src="/omniroute/';
114
- sub_filter_once off;
115
  }
116
 
117
- location /v1/ {
118
- proxy_pass http://127.0.0.1:20128/v1/;
 
 
 
 
 
 
 
 
 
 
 
 
119
  }
120
 
121
  # ----------------------------------------------------
 
30
  proxy_redirect ~^http://jishnupg-opencode-cli\.hf\.space/(.*)$ https://jishnupg-opencode-cli.hf.space/$1;
31
 
32
  # ----------------------------------------------------
33
+ # 1. OMNIROUTE GATEWAY (/omniroute, /login, /dashboard)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  # ----------------------------------------------------
35
  location /omniroute/ {
36
  proxy_pass http://127.0.0.1:20128/;
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
  location = /omniroute {
40
  return 301 /omniroute/;
41
  }
42
 
43
+ location /login {
44
  proxy_pass http://127.0.0.1:20128/login;
45
+ }
46
+
47
+ location /dashboard {
 
 
 
 
 
 
 
 
 
48
  proxy_pass http://127.0.0.1:20128/dashboard;
49
+ }
50
+
51
+ location /models {
52
+ proxy_pass http://127.0.0.1:20128/models;
 
53
  }
54
 
55
  location /omniroute/assets/ {
56
  proxy_pass http://127.0.0.1:20128/assets/;
57
  }
58
 
59
+ location /v1/ {
60
+ proxy_pass http://127.0.0.1:20128/v1/;
 
 
 
 
 
 
61
  }
62
 
63
+ # ----------------------------------------------------
64
+ # 2. OPEN WEBUI (/openwebui, /webui, /auth)
65
+ # ----------------------------------------------------
66
+ location /openwebui/ {
67
+ proxy_pass http://127.0.0.1:8098/;
 
68
  }
69
 
70
+ location = /openwebui {
71
+ return 301 /openwebui/;
72
+ }
73
+
74
+ location /webui/ {
75
+ proxy_pass http://127.0.0.1:8098/;
76
+ }
77
+
78
+ location = /webui {
79
+ return 301 /webui/;
80
+ }
81
+
82
+ location /auth {
83
+ proxy_pass http://127.0.0.1:8098/auth;
84
  }
85
 
86
  # ----------------------------------------------------