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

Apache reverse proxy

silverwind edited this page Mar 7, 2017 · 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:

  • mod_headers
  • mod_proxy
  • mod_proxy_wstunnel
  • mod_rewrite
  • mod_ssl

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

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]

    RequestHeader set X-Forwarded-Proto "https"</strong>
    ProxyPreserveHost On

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

Clone this wiki locally