Fixing the Inertia JS 502 Bad Gateway error in production

Recently, I started encountering 502 Bad Gateway errors when navigating directly to certain routes in this app. However, I did not experience these errors when accessing the same routes through programmatic navigation, such as SPA navigation. After some debugging, I discovered that all the rendered <script> tags caused the response header section links to exceed their limits.

LG

Lauro Guedes

lauroguedesOct 12, 2025
NGINX
502 bad gateway
nginx erro
ssr error
inertia js
0
0
0