-
-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx header limitation #529
Comments
I have the same problem... a route gives me a But this configuration don't solve the problem...
If I use the same component on other pages works fine! How can I solve this problem? |
I solve with
|
Thanks for sharing your insights! Going to close this one but feel free to continue the discussion 🙂 |
The proxy solution works fine for me with Octane proxy_buffer_size 4096k; thanks @trippo |
This was a life safer. Thank you @dnkmdg. I have been banging my head against a wall trying to fix it for a couple of days now. In my case, we weren't getting a 502 error. The response was a blank page with no content and a 200 status response. The HTTP message body was 0 bytes every time. It wasn't until I added an extra header that I got the 502 error and then stumbled upon this post. I checked the header size that page was returning, and the header was 4.6kb! Our machine running the Inertia application had the default
|
Was having random Nginx errors, the fastest way I found how to replicate it was going to a specific page and just reloading and i would get the nginx error. So its different if inertia loads the page initially with html or just sends the json on subsequent requests. Either way this fixed it and you are a savior for me and 2 of my customers. Thanks! |
It was helpful for me. |
proxy_buffer_size 4096k; |
In your nginx config: server {
location ~ \.php$ {
fastcgi_buffer_size 8k;
}
} |
Opening this issue to aid others running into a somewhat bizarre issue, might also be cause for some documentation.
When applying the
@inertia
directive the yielded result contains both the page template and links for all dynamically fetched modules and styles. Recently we started seeing502 Bad Gateway
errors when navigating directly to certain routes in our app, but not when arriving at the same routes from programmatic navigation ie. SPA navigation. After some debugging we found that all of the rendered<script>
tags caused response header sectionlinks
to blow up, thereby causing nginx to fail with a 502.The solution for this is to increase nginx buffers:
A single response could easily look like this, where the "link" section alone is too much for the standard configuration of nginx to handle.
server nginx content-type text/html; charset=UTF-8 vary Accept-Encoding cache-control no-cache, private date Wed, 21 Jun 2023 13:39:41 GMT link <https://my-production-inertia-app.io/build/assets/app-70b4ce10.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/CoolCard-15f160be.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/AuthenticatedLayout-55f1c4db.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/FileUpload-aad0cdad.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/ImageGallery-6f214b75.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/CoolSelect-8cfc798d.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/Show-f86228ba.css>; rel="preload"; as="style", <https://my-production-inertia-app.io/build/assets/app-af524a63.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/Show-d2c761ab.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/GlobalSearchModal-038356f7.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/TextInput-7c60560f.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/UiStore-1d771fae.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/Toast-46e71053.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/BaseButton-9b394d38.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/PrimaryButton-2cf62d91.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/UnderlinedLink-6a468b5c.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/AnonDialog-e37a92bf.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/OutlineButton-76aafa00.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/ImageControls-ccbc8a04.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/CoolCard-30520ede.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/InputError-74da528d.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/index-41b1ba78.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/ShippingItem-ce415210.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/vue-drawing-canvas.esm-f7af890c.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/file-2ba84ccc.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/date-cdab97b8.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/WhiteButton-30bc2cb4.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/PickingLayout-29a854e6.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/use-tracked-pointer-b8f4a78b.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/use-resolve-button-type-3ac7b00a.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/use-controllable-e9af45ec.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/mitt-3a6e1e85.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/_plugin-vue_export-helper-c27b6911.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/FileUpload-5dd25a12.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/ImageGallery-645e2648.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/DangerButton-84d21b86.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/CoolSelect-b9092254.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/ApplicationLogo-6e0281ba.js>; rel="modulepreload", <https://my-production-inertia-app.io/build/assets/ToastArea-73aadd4a.js>; rel="modulepreload" vary X-Inertia
The text was updated successfully, but these errors were encountered: