• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue Laravel app "502 Bad Gateway" on page reload only

halnex

New Pleskian
Server operating system version
Ubuntu 20.04.6 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.72_build1800250901.06 os_Ubuntu 20.04
A specific Laravel 12 application on our Plesk server experiences a "502 Bad Gateway" error, but ONLY on a manual page refresh (F5/Cmd+R) for certain authenticated routes (e.g., `/barber/settings`). Client-side navigation using Inertia's `<Link>` component works perfectly.

Domain: Laravel

Demo Video: Attached below

Version: Plesk Obsidian v18.0.72_build1800250901.06 os_Ubuntu 20.04

Key Findings:

- Laravel logs confirm that the controller method for the failing route executes completely and successfully before the 502 error occurs.
- The error happens *after* the controller logic finishes but *before* the final HTML response can be sent, pointing to a failure in the final rendering step or the PHP-FPM process itself.
- Error log: 1756#0: *57326 upstream sent too big header while reading response header from upstream

What We Have Systematically Ruled Out:

Application Code:
The issue is not caused by slow queries, large data loads, or bad data (the database is nearly empty). We proved all controller data can be serialized to JSON successfully.

Laravel Caching:
All caches (`config`, `route`, `view`, etc.) have been cleared and recreated without success.

Middleware:
We isolated and tested the `HandleInertiaRequests@share` method (ruling out Ziggy and database queries) and the custom `IsBarber` middleware. Neither is the cause.

Server & PHP-FPM Resources:
We have tried increasing `memory_limit` to 512M and `pm.max_children` to 50, and switched the process manager (`pm`) between `dynamic`, `ondemand`, and `static`. The error persists.

Nginx Configuration:
We have disabled "Smart static files processing," turned off "Proxy Mode," and confirmed the `try_files` directive is correct.

Proxy Mode:
We turned off "Proxy Mode" and still received the same error.

PHP Extensions:
We have completely disabled the `opcache` extension.

PHP Version:
The error is identical across multiple Plesk-provided PHP versions (8.2, 8.3, 8.4).

Plesk Environment:
The entire domain and subscription have been deleted and recreated from scratch, and the `plesk repair web` command was run.

Database:
The application has been pointed to a brand new, empty database with a new user.

Session Driver:
The application uses the `database` driver, ruling out file-based session lock issues.

Security:
Plesk's Web Application Firewall (WAF) and `open_basedir` restrictions have been disabled.

This exhaustive process strongly suggests a deep, unloggable fault within the Plesk-managed PHP-FPM service itself on this specific server.
 

Attachments

  • Video_2025-09-08_18-54-20.zip
    993.6 KB · Views: 1
Back
Top