@@ -8,19 +8,22 @@ server {
8
8
resolver 127.0.0.11 ipv6=off;
9
9
10
10
location / {
11
+ set $upstream ui:8080;
12
+
11
13
add_header Cache-Control "no-cache, no-store";
12
14
add_header Pragma "no-cache";
13
15
14
- proxy_pass http://ui:8080 ;
16
+ proxy_pass http://$upstream ;
15
17
proxy_set_header Upgrade $http_upgrade;
16
18
proxy_set_header Connection 'upgrade';
17
- proxy_set_header Host $host;
18
19
proxy_http_version 1.1;
19
20
proxy_cache_bypass $http_upgrade;
20
21
proxy_redirect off;
21
22
}
22
23
23
24
location /api {
25
+ set $upstream api:8080;
26
+
24
27
auth_request /auth;
25
28
auth_request_set $tenant_id $upstream_http_x_tenant_id;
26
29
auth_request_set $username $upstream_http_x_username;
@@ -30,7 +33,7 @@ server {
30
33
proxy_set_header X-Tenant-ID $tenant_id;
31
34
proxy_set_header X-Username $username;
32
35
proxy_set_header X-ID $id;
33
- proxy_pass http://api:8080 ;
36
+ proxy_pass http://$upstream ;
34
37
}
35
38
36
39
{{ if bool (env.Getenv "SHELLHUB_ENTERPRISE") -}}
@@ -46,7 +49,6 @@ server {
46
49
proxy_pass http://$upstream;
47
50
proxy_set_header Upgrade $http_upgrade;
48
51
proxy_set_header Connection 'upgrade';
49
- proxy_set_header Host $host;
50
52
proxy_http_version 1.1;
51
53
proxy_cache_bypass $http_upgrade;
52
54
proxy_redirect off;
@@ -65,12 +67,13 @@ server {
65
67
{{ end -}}
66
68
67
69
location /ssh/connection {
70
+ set $upstream ssh:8080;
71
+
68
72
auth_request /auth;
69
73
auth_request_set $device_uid $upstream_http_x_device_uid;
70
- proxy_pass http://ssh:8080 ;
74
+ proxy_pass http://$upstream ;
71
75
proxy_set_header Upgrade $http_upgrade;
72
76
proxy_set_header Connection 'upgrade';
73
- proxy_set_header Host $host;
74
77
{{ if bool (env.Getenv "SHELLHUB_PROXY") -}}
75
78
proxy_set_header X-Real-IP $proxy_protocol_addr;
76
79
{{ else -}}
@@ -83,10 +86,11 @@ server {
83
86
}
84
87
85
88
location /ssh/revdial {
86
- proxy_pass http://ssh:8080;
89
+ set $upstream ssh:8080;
90
+
91
+ proxy_pass http://$upstream;
87
92
proxy_set_header Upgrade $http_upgrade;
88
93
proxy_set_header Connection 'upgrade';
89
- proxy_set_header Host $host;
90
94
{{ if bool (env.Getenv "SHELLHUB_PROXY") -}}
91
95
proxy_set_header X-Real-IP $proxy_protocol_addr;
92
96
{{ else -}}
@@ -98,10 +102,12 @@ server {
98
102
}
99
103
100
104
location /ssh/auth {
105
+ set $upstream api:8080;
106
+
101
107
auth_request /auth;
102
108
auth_request_set $device_uid $upstream_http_x_device_uid;
103
109
error_page 500 =401 /auth;
104
- proxy_pass http://api:8080 ;
110
+ proxy_pass http://$upstream ;
105
111
proxy_set_header X-Device-UID $device_uid;
106
112
}
107
113
@@ -143,37 +149,46 @@ server {
143
149
{{ end -}}
144
150
145
151
location ~* /api/sessions/(.*)/close {
152
+ set $upstream ssh:8080;
153
+
146
154
auth_request /auth;
147
155
auth_request_set $tenant_id $upstream_http_x_tenant_id;
148
156
error_page 500 =401 /auth;
149
157
rewrite ^/api/(.*)$ /$1 break;
150
158
proxy_set_header X-Tenant-ID $tenant_id;
151
- proxy_pass http://ssh:8080 ;
159
+ proxy_pass http://$upstream ;
152
160
}
153
161
154
162
location /api/devices/auth {
163
+ set $upstream api:8080;
164
+
155
165
auth_request off;
156
166
rewrite ^/api/(.*)$ /api/$1 break;
157
- proxy_pass http://api:8080 ;
167
+ proxy_pass http://$upstream ;
158
168
}
159
169
160
170
location /api/login {
171
+ set $upstream api:8080;
172
+
161
173
auth_request off;
162
174
rewrite ^/api/(.*)$ /api/$1 break;
163
- proxy_pass http://api:8080 ;
175
+ proxy_pass http://$upstream ;
164
176
}
165
177
166
178
location /auth {
179
+ set $upstream api:8080;
180
+
167
181
internal;
168
182
rewrite ^/(.*)$ /internal/$1 break;
169
- proxy_pass http://api:8080 ;
183
+ proxy_pass http://$upstream ;
170
184
}
171
185
172
186
location /ws {
173
- proxy_pass http://ssh:8080;
187
+ set $upstream ssh:8080;
188
+
189
+ proxy_pass http://$upstream;
174
190
proxy_set_header Upgrade $http_upgrade;
175
191
proxy_set_header Connection 'upgrade';
176
- proxy_set_header Host $host;
177
192
178
193
{{ if bool (env.Getenv "SHELLHUB_PROXY") -}}
179
194
proxy_set_header X-Real-IP $proxy_protocol_addr;
0 commit comments