Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
How to use haproxy "replace-path" http-request function
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to use haproxy "replace-path" http-request function (Read 2968 times)
myg63
Newbie
Posts: 5
Karma: 0
How to use haproxy "replace-path" http-request function
«
on:
November 08, 2023, 04:22:45 pm »
Hello @all,
I'm using haproxy for several backend pools with ssl offload which is working fine when I use domains which go thru rules into these backends.
Now I want to use the well documented feature of "redirecting" paths.
So for example a request to
https://test.domain.com/app1
" should be redirected to a backend without the path but still preserving the rest of the path.
It can be used by adding a backend rule "http-request replace-path /xxxx(/)?(.*) /\2" where xxxx is the "virtual" directory
This feature ist documented in
https://www.haproxy.com/blog/path-based-routing-with-haproxy
Please can anyone give advice how to use that feature in opnsense's haproxy implementation?
I'm using latest version 23.7.6
Thanks @all in advance from Germany...
«
Last Edit: November 09, 2023, 11:17:19 am by myg63
»
Logged
myg63
Newbie
Posts: 5
Karma: 0
Re: How to use haproxy "replace-path" http-request function
«
Reply #1 on:
February 14, 2024, 10:50:21 pm »
Does anyone have an Idea?
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1614
Karma: 176
Re: How to use haproxy "replace-path" http-request function
«
Reply #2 on:
February 15, 2024, 08:44:33 am »
I wouldn't try to do this. Here is a great explanation on why this is a bad idea:
https://caddy.community/t/the-subfolder-problem-or-why-cant-i-reverse-proxy-my-app-into-a-subfolder/8575
I would rather use subdomains that are called like the app and reverse proxy the entire webroot per app.
"foo.example.com" -> 192.168.1.1:80
"bar.example.com" -> 192.168.1.2:443
... etc...
That will really save you a lot of headache.
«
Last Edit: February 15, 2024, 08:48:30 am by Monviech
»
Logged
Hardware:
DEC740
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
How to use haproxy "replace-path" http-request function