I would like to access my nextcloud instance from the internet. It is reachable within my network via cloud.daninet.local, and i want to access it externally via mydomain.com/cloud. This is the config i have come up with so far:
frontend hass
bind MY_EXTERNAL_IP
mode http
log global
option httplog
option http-keep-alive
option forwardfor
acl https ssl_fc
http-request set-header X-Forwarded-Proto http if !https
http-request set-header X-Forwarded-Proto https if https
timeout client 30000
acl cloud var(txn.txnpath) -m beg -i /cloud
acl hass var(txn.txnpath) -m beg -i /cloud
acl aclcrt_hass var(txn.txnhost) -m reg -i ^MY_DOMAIN(:([0-9]){1,5})?$
http-request set-var(txn.txnpath) path
http-request set-var(txn.txnhost) hdr(host)
use_backend hass_ipvANY if !hass aclcrt_hass
use_backend nextcloud_ipvANY if cloud aclcrt_hass
backend nextcloud_ipvANY
mode http
id 102
log global
timeout connect 30000
timeout server 30000
retries 3
acl all var(txn.txnhost) -m str -i asdfaefawdfasf
http-request set-var(txn.txnhost) hdr(host)
reqrep ^([^\ ]*\ /)cloud[/]?(.*) \1\2
server cloud.daninet.local 192.168.1.7:443 id 101 ssl check inter 1000 ca-file /var/etc/haproxy/ca_5d29b4f7c9c1f.pem crt /var/etc/haproxy/server_clientcert_5de3a4922aebc.pem
Now when i open mydomain.com/cloud i get to mydomain.com/login instead of mydomain.com/cloud/login. I also tried to make nextcloud run on cloud.daninet.local/cloud, but apparently there is some bug in the docker version, so that is not an option..
Could anyone help me out here?