Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Apache reverse proxy

silverwind edited this page Jan 20, 2018 · 13 revisions

Below is an example virtual host configuration for an Apache 2.4 reverse proxy for droppy. Make sure that the following modules are loaded (uncomment them in httpd.conf):

  • mod_headers
  • mod_proxy
  • mod_proxy_wstunnel
  • mod_remoteip
  • mod_rewrite
  • mod_ssl

Virtual Host Configuration

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName droppy.example.com
    Redirect permanent / https://droppy.example.com/
</VirtualHost>

NameVirtualHost *:443
<VirtualHost *:443>
    ServerName droppy.example.com
    ErrorLog /var/log/httpd/droppy.example.com.log

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/droppy.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/droppy.example.com/privkey.pem

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/!/socket [NC]
    RewriteRule /(.*) ws://127.0.0.1:8989/$1 [P,L]

    RemoteIPHeader X-Forwarded-For
    RequestHeader set X-Forwarded-Proto "https"
    ProxyPreserveHost On

    ProxyPass / http://127.0.0.1:8989/
    ProxyPassReverse / http://127.0.0.1:8989/
</VirtualHost>

Additional tuning like in the nginx configuration might be necessary to make long-running uploads work correctly.

Clone this wiki locally