Closed kamranahmedse closed 1 month ago
I think this is the same as https://github.com/withastro/astro/issues/12192. I'll close this in favour of that for now, but this is indeed an urgent issue that we'll look into as soon as possible on Monday. Sorry for the regression!
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
This recent change which is always adding
req.socket.remotePort
to the URL has caused our production app to have timeouts whenever a non-existent URL is accessed (i.e. 404 page is never rendered).We have the following setup in production
Since the request is being proxied through CloudFront and Nginx, the
req.socket.remotePort
value would correspond to the port used by Nginx (which is forwarding the request to the Node.js server) rather than the client's original port. Typically, this port is dynamically assigned by Nginx for each outgoing connection when proxying requests, so the value would depend on the specific connection instance Nginx used to communicate with the Node.js server.I changed my Nginx configuration to add
X-Forwarded-Port
which has fixed it for us but I still think enforcingreq.socket.remotePort
is not the right thing to do in the framework sinceX-Forwarded-Port
is not always present by default.What's the expected result?
Proxied setup should work fine.
Link to Minimal Reproducible Example
Can't add because it only happens in the proxy setup I detailed in the issue.
Participation