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 Apr 10, 2016 · 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_ssl
  • mod_rewrite
  • mod_proxy
  • mod_proxy_wstunnel

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 *:80
<VirtualHost *:443>
    ServerName droppy.example.com
    ErrorLog /var/log/httpd/droppy-error.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}  ^/                     [NC]
    RewriteCond %{QUERY_STRING} socket                 [NC]
    RewriteRule /(.*)           ws://127.0.0.1:9898/$1 [P,L]

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

Clone this wiki locally