OPNsense Forum

English Forums => General Discussion => Topic started by: paul199513 on December 19, 2021, 12:50:27 AM

Title: HAproxy www to non-www
Post by: paul199513 on December 19, 2021, 12:50:27 AM
Hey everyone, currently i am playing around with the HAproxy feature of the OPNsense Firewall. I need to redirect https://www.example.com to https://example.com and don't know, how i could achieve this.

Hopefully somebody could help me :)
Title: Re: HAproxy www to non-www
Post by: CapJak on March 05, 2022, 04:41:03 PM
Did you ever figure this out?
Title: Re: HAproxy www to non-www
Post by: cookiemonster on March 05, 2022, 11:49:06 PM
I'm not knowledgeable on haproxy but I would probably do a condition and a rule.
First I'd create a condition "Traffic is HTTP".
Then a rule that would use that condition, and execute a "http-request redirect".
Then compare the result config with the manual http://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4-redirect (http://cbonte.github.io/haproxy-dconv/2.4/configuration.html#4-redirect)