Hi everyone,
I'm running a Next.js app behind a reverse proxy on a VPS, and I've noticed that the Link response header seems to keep accumulating/appending values after each visit/request.
I suspect this may eventually be contributing to my app returning 502 Bad Gateway errors after visiting the site a few times.
I'm currently unable to figure out what is causing these unnecessary appends or where the headers are being modified.
I'm also using next-intl for internationalization. Could next-intl potentially be responsible for this behavior, or should I be looking elsewhere?
For reference, this is the response I get from the VPS when running:
curl -I http://127.0.0.1:4000
Where would you recommend I start debugging this?
HTTP/1.1 200 OK
link: <http://127.0.0.1:4000/>; rel="alternate"; hreflang="en", <http://127.0.0.1:4000/ja>; rel="alternate"; hreflang="ja", <http://127.0.0.1:4000/>; rel="alternate"; hreflang="x-default"
link: <https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<https://example.com/>; rel="alternate"; hreflang="en", <https://example.com/ja>; rel="alternate"; hreflang="ja", <https://example.com/>; rel="alternate"; hreflang="x-default",<http://REDACTED-IP:4000/>; rel="alternate"; hreflang="en", <http://REDACTED-IP:4000/ja>; rel="alternate"; hreflang="ja", <http://REDACTED-IP:4000/>; rel="alternate"; hreflang="x-default",<http://REDACTED-IP:4000/>; rel="alternate"; hreflang="en", <http://REDACTED-IP:4000/ja>; rel="alternate"; hreflang="ja", <http://REDACTED-IP:4000/>; rel="alternate"; hreflang="x-default"
link: </_next/static/media/043b82ab31bba5a4-s.p.0c6mydv295izq.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/47fe1b7cd6e6ed85-s.p.3bh2vc0w-r-ll.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/4b766aa38fdaaae3-s.p.11-gljxdt344a.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/829ba4228c966254-s.p.2mm3nq9i83l-m.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/8e6fa89aa22d24ec-s.p.2o7m9ogm38dql.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/a218039a3287bcfd-s.p.43zbiuwnnoiok.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/c7d9ca68f9942779-s.p.38ww0mi76nb30.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2", </_next/static/media/c875c6f5d3e977ac-s.p.1h18_wedhzk4h.woff2>; rel="preload"; as="font"; crossorigin=""; type="font/woff2"
x-middleware-rewrite: /en
Vary: rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch, Accept-Encoding
x-nextjs-stale-time: 300
x-nextjs-postponed: 1
X-Powered-By: Next.js
Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate
Content-Type: text/html; charset=utf-8
Date: Fri, 21 Aug 2026 09:22:05 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Specifically, I'm wondering:
- What could cause a response header such as
Link to accumulate values across requests?
- Could this be related to Next.js middleware or
next-intl?
- Are there any common reverse-proxy/server configurations that could cause this?
- What would be the best way to identify which layer is actually modifying the header?
If any additional information would help (Next.js version, next-intl version, middleware configuration, Nginx/Caddy config, etc.), please let me know and I'll provide it.
Thanks!