Added Doc for installing behind revprox

This commit is contained in:
2021-01-18 16:17:59 +01:00
parent ed69f081b8
commit 89786ee37b

View File

@@ -0,0 +1,98 @@
# Installing in network with existing Nginx reverse proxy
## Forwarding Webui,and api/agent connection path
Nginx config
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name _;
location / { {
proxy_pass http://<ip of internall shellhub host>;
proxy_set_header Host $host;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~ ^/(ssh|ws)/ {
proxy_pass http://<ip of internall shellhub host>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
}
```
## Forwarding only api/agent connection path
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location / {
return 403;
}
location ~ ^/(info|api|auth|install.sh|kickstart.sh) {
proxy_pass http://<ip of internall shellhub host>;
proxy_set_header Host $host;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location /ssh/ {
proxy_pass http://<ip of internall shellhub host>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
}
```
## Forwarding only Webui
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location / {
proxy_pass http://<ip of internall shellhub host>;
proxy_set_header Host $host;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location ~ ^/(info|auth|install.sh|kickstart.sh) {
return 403;
}
location /ws/ {
proxy_pass http://<ip of internall shellhub host>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
}
```