From 5cd85f7e543f558a15030d5c477cd952348f0df9 Mon Sep 17 00:00:00 2001 From: Silas Brown Date: Sat, 29 Oct 2022 18:07:03 +0100 Subject: [PATCH] add example config for nginx subdirectory --- README.md | 17 +++++++++++++++++ README.rst | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/README.md b/README.md index ad77175e..2f577b71 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,23 @@ location / { } ``` +If the Nginx server is also serving a website, +you can have it put WebSSH into a subdirectory: + +```nginx +location = /webssh { + return 302 /webssh/; +} +location /webssh/ws { + proxy_pass http://127.0.0.1:8888/ws; + proxy_http_version 1.1; + # ... (rest as above) +} +location /webssh/ { + proxy_pass http://127.0.0.1:8888/; +} +``` + Running as a standalone server ```bash wssh --port=8080 --sslport=4433 --certfile='cert.crt' --keyfile='cert.key' --xheaders=False --policy=reject diff --git a/README.rst b/README.rst index f435d157..c7fb9b5c 100644 --- a/README.rst +++ b/README.rst @@ -214,6 +214,23 @@ Running behind an Nginx server proxy_set_header X-Real-PORT $remote_port; } +If the Nginx server is also serving a website, +you can have it put WebSSH into a subdirectory: + +.. code:: nginx + + location = /webssh { + return 302 /webssh/; + } + location /webssh/ws { + proxy_pass http://127.0.0.1:8888/ws; + proxy_http_version 1.1; + # ... (rest as above) + } + location /webssh/ { + proxy_pass http://127.0.0.1:8888/; + } + Running as a standalone server .. code:: bash