Reputation: 1390
On my Laravel app, I have a form that is validated using standard Laravel validation. If it fails, it simply redirects back to the same form and displays the errors. This is working perfectly fine on my local machine as well as on the dev site (which is hosted on the same server as production).
However, in my production site, the error produces a 502 Bad Gateway page (rendered by CloudFlare).
The only difference that I can find between the dev & production (or staging) sites is the environment configuration (most notably APP_ENV
). I would think this might be an error to do with SSL and redirecting, but the dev environment has the same SSL settings as the staging & production, but dev shows the errors on the page as it is supposed to be, whereas staging & production shows 502. I could not find anything in the nginx or Laravel error logs. I would like some direction if anyone has dealt with this, where to look, whether it's ngnix configuration, Cloudflare configuration, SSL configuration, or Laravel configuration.
Upvotes: 3
Views: 2409
Reputation: 1390
This seemed to be solved with the following put in the nginx
config:
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
So far no side effects, I will give it a few days to see that all functions well before confirming this as a fix.
Upvotes: 3
Reputation: 41320
in the Nginx config set
fastcgi_intercept_errors off;
It determines whether FastCGI server responses with codes greater than or equal to 300 should be passed to a client or be intercepted and redirected to nginx for processing with the error_page directive.
Syntax: fastcgi_intercept_errors on | off;
Default: fastcgi_intercept_errors off;
Context: http, server, location
Upvotes: 0