key-networks / ztncui

ZeroTier network controller UI
GNU General Public License v3.0
1.53k stars 228 forks source link

Support Running Behind Proxy #29

Closed Ventriduct closed 4 years ago

Ventriduct commented 4 years ago

I tried to set up ztncui behind an HTTPS Apache2 proxy with a url of https://localhost/zt but ztncui expects resources (CSS, JS, images, etc.) to be under root (https://localhost/ instead of /zt). I think it would be useful to be able to configure the public root directory used for links and other resources within ztncui.

Thanks, Ziah

Ventriduct commented 4 years ago

Sorry this was already asked in #11

Fastidious commented 4 years ago

@ziah I use Caddy, using v1.0 stable, and this is my Caddyfile:

zt.example.com {
        log /var/log/caddy/zt.example.com.log {
                rotate_size 1
                rotate_age  7
                rotate_keep 1
        }
        header / {
                Strict-Transport-Security "max-age=31536000"
                X-XSS-Protection "1; mode=block"
                X-Content-Type-Options "nosniff"
                X-Frame-Options "DENY"
                -Server
        }
        tls {
                key_type rsa4096
                protocols tls1.2
                must_staple
        }
        proxy / http://127.0.0.1:3030 {
                transparent
        }
}

It works regardless.

key-networks commented 4 years ago

Thanks @Fastidious