98 lines
2.5 KiB
Markdown
98 lines
2.5 KiB
Markdown
# 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;
|
|
}
|
|
}
|
|
``` |