deployment within apache as reverse proxy
See original GitHub issuehey man, just a quick information, maybe it’s useful for someone else. I run an Apache https webserver as reverseproxy and had some difficulties with the connection upgrade to websockets - but now it’s running correct with the following config:
activate needed apache modules:
a2enmod proxy proxy_http proxy_html proxy_wstunnel filter rewrite substitute
# webssh.conf
#
# https://mydomain.org/ssh
# Config for WebSSH Portal
##
<Location /ssh >
ProxyPass http://127.0.0.1:8888
ProxyPassReverse http://127.0.0.1:8888
# for websocket stuff
RewriteEngine On
RewriteCond %{HTTP:Upgrade} ^WebSocket$ [NC, OR]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC, OR]
RewriteRule .* ws://localhost:8888/ws$1 [P,L]
# rewrite response html to fix paths
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|static/js/|/ssh/static/js/|i"
Substitute "s|static/css/|/ssh/static/css/|i"
Substitute "s|static/img/|/ssh/static/img/|i"
</Location>
Also i created a systemd service to ensure webssh is running
vi /etc/systemd/system/webssh.service
with following content:
[Unit]
Description=Python WebSSH
After=syslog.target network.target
StartLimitBurst=5, StartLimitIntervalSec=10
[Service]
ExecStart=/path/to/webssh_env/bin/wssh --address=127.0.0.1 --origin=https://mydomain.org --port=8888 --log-file-prefix=/var/log/webssh.log
ExecReload=/bin/kill -HUP $MAINPID
Type=simple
PIDFile=/var/run/webssh.pid
Restart=on-failure
RestartSec=1
[Install]
WantedBy=multi-user.target
systemctl daemon-reload && systemctl enable webssh.service && systemctl start webssh.service
regards!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
How to setup an Apache reverse proxy server example
Reverse proxy setup steps · Install Apache and the origin servers · Apache Tomcat app deployment · Apache mod_proxy library · Apache proxypass ......
Read more >How To Use Apache HTTP Server As Reverse-Proxy Using ...
In this DigitalOcean article, we are going to see set up Apache on Ubuntu 13 and use it as a reverse-proxy to welcome...
Read more >Configuring Apache HTTP Server as a reverse proxy for ... - IBM
Uncomment these modules: LoadModule proxy_module modules/mod_proxy.so · Go to the SSL configuration section, which starts with #Secure (SSL/TLS) connections .
Read more >Apache 2.4 as a Reverse Proxy | By Michael Whittle
In order to demonstrate this you will need to deploy two Apache servers as per the tutorial above. One will be the reverse...
Read more >Configure Apache HTTP Server as Reverse Proxy for brXM
Configure the Apache HTTP Server ("httpd") as a reverse proxy for the CMS and delivery tier web applications. Background. When deploying a Hippo...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yet another working example as a virtual host:
If you get an error about Cross origin not being allowed, add
ProxyPreserveHost On
to your config.