apache.conf 1.22 KB
Newer Older
Felix Bartels's avatar
Felix Bartels committed
1 2 3 4 5 6
<VirtualHost *:80>
    DocumentRoot /app/code

    ErrorLog "/dev/stderr"
    CustomLog "/dev/stdout" combined

7 8 9 10 11 12 13 14
    # rewrite websocket connections to its own endpoint
    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /(.*)           ws://127.0.0.1:3012/$1 [P,L]

    ProxyPreserveHost On
    ProxyErrorOverride Off
    ProxyPass / http://127.0.0.1:3000/
Felix Bartels's avatar
Felix Bartels committed
15 16 17 18 19 20 21 22 23

    <Location /admin>
        AllowOverride None
        Order deny,allow
        Deny from All

        AuthType Basic
        AuthBasicProvider ldap
        AuthName "Use your Cloudron admin account to login"
Johannes Zellner's avatar
Johannes Zellner committed
24 25 26
        AuthLDAPURL ${CLOUDRON_LDAP_URL}/${CLOUDRON_LDAP_USERS_BASE_DN}?username?sub?(memberof=cn=admins,${CLOUDRON_LDAP_GROUPS_BASE_DN})
        AuthLDAPBindDN "${CLOUDRON_LDAP_BIND_DN}"
        AuthLDAPBindPassword "{CLOUDRON_LDAP_BIND_PASSWORD}"
Felix Bartels's avatar
Felix Bartels committed
27 28 29 30 31
        Require valid-user
        Satisfy any

        ProxyPreserveHost On
        ProxyErrorOverride Off
32
        ProxyPass http://127.0.0.1:3000/admin/
Felix Bartels's avatar
Felix Bartels committed
33 34 35 36 37 38 39 40 41 42 43 44 45
    </Location>

    <Location /healthcheck>
        Order allow,deny
        Allow from all
        Satisfy Any

        ErrorDocument 200 "ok"
        RewriteEngine On
        RewriteRule "/healthcheck" - [R=200]
    </Location>

</VirtualHost>