Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.1 Legacy Series
»
HAProxy: accessing multiple sites by typing a "folder" name?
« previous
next »
Print
Pages: [
1
]
Author
Topic: HAProxy: accessing multiple sites by typing a "folder" name? (Read 1038 times)
jonf
Newbie
Posts: 23
Karma: 1
HAProxy: accessing multiple sites by typing a "folder" name?
«
on:
February 02, 2023, 11:13:36 am »
Hi,
I currently have a DDNS hostname which points to my IP address and this is currently setup to redirect to one of my Docker containers on my server in the HAProxy settings. I have a second container which I also want to access remotely and I was wondering if I can do this in such a way that I could type a "folder" name after the hostname that would correspond to the container I want to access.
For instance, if I have Docker containers named 'first' and 'second', I would like to be able to type the following in the web browser to access each one respectively:
https://[hostname]/first
https://[hostname]/second
Is this possible in HAProxy?
Logged
meyergru
Hero Member
Posts: 1694
Karma: 166
IT Aficionado
Re: HAProxy: accessing multiple sites by typing a "folder" name?
«
Reply #1 on:
February 02, 2023, 12:58:39 pm »
It probably is, but more often than not, this has the problem that internal redirections of sites behind that kind of reverse proxy assume absolute URLs, such that they redirect you to something like /admin/logout which would not work if the site is under /first.
However, if you own a DNS domain, you can also CNAME *.domain.tld to your DDNS domain. In that case, you can map via hostnames and define any hostname on your OpnSense haproxy via a map file.
This would even work without a separate domain, because often, you get *.yourhostname.domain.tld as an automatic alias to yourhostname.domain.tld. I think Cloudflare offers this...
Logged
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005
1100 down / 440 up
,
Bufferbloat A+
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.1 Legacy Series
»
HAProxy: accessing multiple sites by typing a "folder" name?