sharry icon indicating copy to clipboard operation
sharry copied to clipboard

Apache Reverse Proxy

Open Mq89 opened this issue 7 months ago • 3 comments

As I invested quite some time to figure this out, I wanted to share the Apache configuration I use for the reverse proxy. The offical docs provide the Nginx config, but I am kind of stuck with apache on that particular machine.

  • Sharry is running in a docker container basically as provided by this repository.
  • Obviously, I changed the actual domain to example.com.
  • Apache mods for reverse proxy need to be enabled.
  • As stated in the official docs, Sharry is currently not capable of running in a subdirectory. Hence, a subdomain is the only way to go.
<VirtualHost *:443>
        ServerName sharry.example.com

        ProxyPreserveHost   On
        ProxyPass           /   http://127.0.0.1:9090/
        ProxyPassReverse    /   http://127.0.0.1:9090/
        RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

        RewriteEngine On
        RewriteCond %{HTTP:Connection} Upgrade [NC]
        RewriteCond %{HTTP:Upgrade} =websocket [NC]
        RewriteRule /(.*) ws://127.0.0.1:9090/$1 [P,L]
        
        Include /etc/letsencrypt/options-ssl-apache.conf

        Timeout 28800
        KeepAlive On

        SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>

Mq89 avatar Jul 04 '24 19:07 Mq89