Massive link headers causing site failures #6519
Replies: 5 comments 11 replies
-
I ran into the same issue and @kevinrenskers solution of adding those options to the top line of my 443 server block worked for me too. I'm on version 1.0.0-next.465 and use the node-adapter. I have a route that uses a slug that couldn't be reloaded in production, but could be navigated to from parent directory via client-side nav. When reloading the slug page, the 502 would show up and you'd have to push back on the browser and then refresh again to get the site working. I found the exact same error as above in my NGINX logs. |
Beta Was this translation helpful? Give feedback.
-
Can you see if setting this option helps: #2612 (comment) If it doesn't, would it be possible to share your code? I'm curious why your page would be using so many JS files |
Beta Was this translation helpful? Give feedback.
-
This should be reported as an issue ? |
Beta Was this translation helpful? Give feedback.
-
Per #6790 (comment), this is easy to fix in a export function handle({ event, resolve }) {
const response = await resolve(event);
response.headers.delete('link');
return response;
} |
Beta Was this translation helpful? Give feedback.
-
Yeah, we had to increase the proxy buffer in our NGINX config in order to fix this issue, since link header becomes quite too long.
We also saw that preload links are also represented in the form of HTML tags inside the element. |
Beta Was this translation helpful? Give feedback.
-
Today I ran into a really strange issue: when I opened https://www.critical-notes.com/campaigns/130/characters/4955 I got an error 502 Bad Gateway page from Nginx, but I was able to load https://www.critical-notes.com/campaigns/130/characters just fine, and navigate to a character. But I couldn't reload, or I would get the 502 again.
After some searching I found out that the link header is so big that nginx just refuses to deal with it:
2022/09/01 22:36:39 [error] 3352048#3352048: *4228330 upstream sent too big header while reading response header from upstream, client: 35.237.4.214, server: www.critical-notes.com, request: "GET /campaigns/130/characters/4955 HTTP/1.1", upstream: "http://127.0.0.1:3000/campaigns/130/characters/4955", host: "www.critical-notes.com"
And looking at the header, there are a LOT of JS files in there, it's really rather big.
I did managed to solve it by adding this to my nginx site config:
But is this to be expected? What's that link header doing, does it need to be so big? Is this documented somewhere? And in general, is there any documentation on hosting this yourself? I am currently using adapter-node and nginx and it works (until it doesn't). Would love to get some official docs on this.
Beta Was this translation helpful? Give feedback.
All reactions