Le 22-Feb-2021 14:02:46 +0100, al-hapr...@none.at a crit: Hi. On 22.02.21 01:31, Igor Cicimov wrote: > > But if I do some configuration tweaks in "wp-config.php", like adding the > following two lines : > define('WP_HOME', 'https://front1.domain.local '); > define('WP_SITEURL', 'https://front1.domain.local '); > > It seems to work correctly. > > It is not an acceptable solution however, as these WP instances will be > managed by people who are not really tech-savvy. > > So I wonder if HAProxy could provide a setup with all the required > modifications, > rewritings, ... allowing both worlds to coexist in a transparent way : > - usable WP site while browsing the "real" URLs from the backend > - usable WP site while browsing through HAProxy. > > Right now WP is my concern, but I am sure this is a reusable "pattern" for > future needs. > > Regards > > > This is a requirement for most apps behind a reverse proxy -- you simply have > to > tell the app that it is behind a reverse proxy so it can set correct links > where needed. > > In your case if you google for "wordpress behind reverse proxy" I'm sure > you'll > get a ton of resources that can point you in the right direction for your use > case like using X-FORWARD headers for example or whatever suits you.
>Full Ack to Igor's statment. >A a further Idea maybe you can replace the response. >http://cbonte.github.io/haproxy-dconv/2.3/configuration.html#4.2-http-response%20replace-header >http://cbonte.github.io/haproxy-dconv/2.3/configuration.html#4.2-http-response%20replace-value >It could be tricky for a huge amount of hosts, due to this fact I suggest to >setup WP with WP_HOME and WP_SITEURL which is possible via wp-admin via GUI :-) >You can also create a smal setup tool which adds the values to the wp_config >and >add the haproxy map entry for the domain. >Regards >Alex Hi, Thank you all for these answers, I cannot defeat PHP world :-) So I will indeed generate the required configurations for around 40 instances with a small tool named Ansible :-))) Regards ------------------------------------------------------------------------------------------------- FreeMail powered by mail.fr