Now, we have installed a blog site (PHP/WordPress) at /blog on our server which is served from the subdomain https://blog.upgrade-hub.com
As you would have guessed, what we really need is serve it from the same www domain without a redirection. So in Netlify, I have a proxy/rewrite set up like this in a _redirects root file:
That thread is addressing a different issue. The person who opened the topic only set up a proxy through a path and pages on that path required resources on sibling paths. They needed to add additional rules for those uncovered paths.
But my issue is different: the proxy mainly works. Only it won’t work when the communication needs to be transactional. i.e. for security reasons, the server needs to identify a user correctly, such as when logging in. It probably is due to some missed custom header configuration that I’ve not been able to unravel myself.
This doesn’t sound like a Netlify issue. Netlify is proxying correctly, it’s the target URL that’s returning a 502. You should try contacting that server to ask for more details on why that’s failing.
Actually, the target URL returns 403 to Netlify when proxying. And Netlify is carrying that as a user-facing 502. I was wondering that, since all regular pages are working, maybe there was something wrongly setup in Netlify and other people might be in the same position, hence why asking in the forum. Thanks.
That is a 502 status above. The third-party system is returning the 502 which Netlify then proxies unchanged. If you want to fix these 502s, they must be fixed on the third-party system which is not controlled by Netlify.
Hi, @jdvivar. They are not 403s because the access logs don’t matter at all. The only thing that matters is what the server sends to the client and the server is only sending the 502.
I know you see a 403 in your logs. However, that URL doesn’t return a 403. It is returning a 502 to the client. I just tested again now:
It is beyond dispute that the status code is a 502 above. The access logs don’t matter because no client can see the access logs. The only status the client (“the client” meaning my curl command, a web browser, or Netlify’s proxy service) can see is the 502. The 403 is never shown to the client. That is an internal status code but not what reaches the client.
So, the server is returning a 502 and Netlify is simply proxying that 502 along. This issue will continue until you can fix the target so it no longer returns a 502.
I see it is returning a 200 for you. Do you possibly have a firewall or other access controls that only send a 200 response for specific IP addresses?
Thanks, yes, I’m assuming there’s server configuration at the host provider level that’s letting some IPs pass and blocking others. Thanks to your input I realised that was the root cause, in fact.