apache.conf 1.18 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"
24
        AuthLDAPURL ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username?sub?(memberof=cn=admins,${LDAP_GROUPS_BASE_DN})
Felix Bartels's avatar
Felix Bartels committed
25 26 27 28 29 30 31
        AuthLDAPBindDN "${LDAP_BIND_DN}"
        AuthLDAPBindPassword "{LDAP_BIND_PASSWORD}"
        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>