WordPress home page redirect loop behind proxy
-
We have a fully configured WordPress/Woocommerce installation at “
wordpress.example.com“, and an nginx proxy in front of it at “public.example.com“, all working well, except for this:In order for the payment gateway to get & display the correct url (public.example.com/…) to send customers back to after processing, we have to set wordpress urls as follows:
home | https://public.example.com siteurl | https://wordpress.example.comThis is tantalizing close to all working. The only problem is that a request for the home page (specifically and only) at https://public.example.com results in a 301 redirect loop. All other pages work as expected.
I can see what the problem is – on the front end the stanza:
server_name public.example.com; ... proxy_pass https://wordpress.example.com;will indeed send the request to exactly
https://wordpress.example.com/but wordpress then replies with no, no – 301, you need to head over to https://public.example.com and the browser ends up in a loop.I cannot see how to specifically prevent wordpress from issuing a 301 for wordpress.example.com (only) and instead return 200 OK and the content.
Can anyone help please?
The topic ‘WordPress home page redirect loop behind proxy’ is closed to new replies.