eikek / sharry

Sharry is a self-hosted file sharing web application.
https://eikek.github.io/sharry
GNU General Public License v3.0
866 stars 55 forks source link

Apache Reverse Proxy #1442

Open Mq89 opened 3 months ago

Mq89 commented 3 months ago

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.

<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>
eikek commented 3 months ago

Thank you @Mq89 - so is this config a working example? It could be added to the docs similar to the nginx one, right? If you like, you could add it there, branch off of current-docs.

Mq89 commented 2 months ago

Yes, it is a working example. I can provide an update for the docs, but it will take me a couple of days.

eikek commented 2 months ago

Thank you! And there is no rush at all! (if I find some time before, I can also add it, let's see 😄)