diff --git a/Install-behindNginxRevProx.md b/Install-behindNginxRevProx.md new file mode 100644 index 0000000..59df0e2 --- /dev/null +++ b/Install-behindNginxRevProx.md @@ -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://; + 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://; + 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://; + proxy_set_header Host $host; + proxy_set_header X-Scheme $scheme; + proxy_set_header X-Real-IP $remote_addr; + + } + location /ssh/ { + proxy_pass http://; + 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://; + 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://; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + } +} +``` \ No newline at end of file