iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Antihost offers managed WordPress hosting with free migration, one-click staging and a 14-day free trial.
A 504 Gateway Timeout means a gateway or reverse proxy did not receive a timely response from an upstream service. In a WordPress installation, that upstream can be PHP-FPM, another web server, a load balancer, a database-dependent process, or an external API. Nginx is where the error becomes visible, but it is not necessarily the cause.
Fix the problem by identifying the exact request and timeout layer in the logs, then correcting the slow or unavailable upstream. Increase an Nginx timeout only when the request is legitimate, the evidence supports it, and the matching PHP, PHP-FPM, and load-balancer limits are aligned.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWhat a 504 means in an Nginx WordPress stack
HTTP status 504 is the GATEWAY_TIMEOUT condition: a gateway or reverse proxy waited for an upstream response and gave up. Nginx may be waiting for PHP-FPM through FastCGI, for an application server through proxy_pass, or for a service behind a load balancer. WordPress itself can also be waiting on a database query, a remote API, media processing, or another internal request.
The status identifies a failed boundary, not the failed component. A blocked PHP-FPM worker, a slow plugin query, an unavailable API, and an incorrectly chosen Nginx directive can all produce the same browser message. The first useful question is therefore not “How do I make Nginx wait longer?” but “Which URL, upstream, and timer ended this request?”
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
Start with the failing request
Write down the complete URL, HTTP method, and the time shown by the browser or monitoring system. Record whether the request is a public page, wp-admin screen, REST endpoint, AJAX action, cron task, import, backup, or publishing operation. Note whether every visitor fails or only one operation or user does.
This description narrows the search. A site-wide failure points toward infrastructure, capacity, or an upstream service. A single import or admin action points more often toward application code, a database operation, media processing, or a request-specific limit. Keep the timestamp in UTC or include the server timezone so Nginx and PHP-FPM entries can be matched accurately.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Read Nginx logs before changing settings
At the recorded time, inspect the Nginx error log and access log. The most useful error entry usually contains upstream timed out, the upstream address or FastCGI socket, and an indication of whether Nginx was waiting for response headers or for later response data.
Timing fields make this comparison objective. An access log can record total request time and upstream response time; Nginx documents this timing-aware logging approach. If the upstream time reaches a repeatable interval while the total time is similar, that interval is evidence of the timer that closed the request. If no upstream connection was made, investigate routing, sockets, DNS, or process availability instead of read timeouts.
Compare several failures, not just one line. A precise 60-second pattern, an immediate failure, and an interval that varies with server load suggest different causes. Preserve the relevant log excerpts before rotating or clearing logs.
Identify the active upstream path
Open the server block and the location that handles the failing URL. WordPress Nginx configurations commonly send PHP files to a PHP-FPM socket with fastcgi_pass. Other deployments send requests to an application server with proxy_pass. A load balancer may sit in front of either path.
| Configuration path | Directive family to inspect | What the upstream is usually doing |
|---|---|---|
| Nginx reverse proxy | proxy_pass and proxy_read_timeout |
Waiting for a proxied web or application server to send data |
| Nginx to PHP-FPM | fastcgi_pass and fastcgi_read_timeout |
Waiting for PHP-FPM to return WordPress output |
| Another gateway or load balancer | Provider or platform timeout settings | Waiting for the next upstream layer, which may close the connection first |
Inspect the configuration that Nginx actually loaded, including included files and location-specific overrides. A value in a template or inactive virtual host does not affect the request. If the log names a Unix socket, verify that the socket exists and belongs to the PHP-FPM pool serving this site.
Understand Nginx timeout semantics
proxy_read_timeout is for proxied servers
For requests handled by proxy_pass, Nginx documents a default proxy_read_timeout of 60 seconds. It is an idle-read timer: Nginx closes the connection when the proxied server transmits nothing during that interval.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
That timer is not a maximum for the entire response. Nginx states that the timeout is set only between two successive read operations, not for transmission of the whole response. A streaming response that sends data periodically can therefore remain open longer than 60 seconds, while a server that sends nothing for 60 seconds can time out even if it would eventually finish.
fastcgi_read_timeout is for PHP-FPM
Requests passed to PHP-FPM use FastCGI, so the relevant Nginx setting is fastcgi_read_timeout in the active PHP location. Changing proxy_read_timeout does not extend a FastCGI request, and changing fastcgi_read_timeout does not affect a request sent with proxy_pass.
Free tools Windows power users keep installed
One-click scans. No signup required.
Find the directive in the same location that contains fastcgi_pass. Check inherited server-level values and any location override before editing. The effective value, not a value copied from a tutorial, determines when Nginx stops waiting.
Check the inner PHP and platform limits
Nginx is only one timer in the chain. Compare its read timeout with the PHP-FPM pool’s request_terminate_timeout, PHP’s max_execution_time, and any hosting-platform or load-balancer limit. A shorter inner limit can terminate PHP before Nginx reaches its own limit. Making Nginx wait longer cannot revive a PHP process that PHP-FPM has already killed.
PHP-FPM status and pool logs can reveal a saturated worker pool, child-process exits, memory failures, or requests terminated by the pool. If all workers are busy, a new request may wait in a queue before PHP begins executing WordPress. Increasing the outer Nginx timer in that situation can leave more connections waiting while reducing capacity for other visitors.
Check available memory and CPU at the failure time as well. A process repeatedly killed by the operating system, or a host that enforces a hard request limit outside your configuration, requires capacity or code changes rather than a larger Nginx value.
Enable WordPress logging temporarily
WordPress can log PHP and application errors without displaying them to visitors. In wp-config.php, place these definitions before the line that says to stop editing:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
This enables debugging, disables on-screen error display, and writes errors to wp-content/debug.log. Reproduce the failing operation once, then inspect entries at the matching timestamp. Fatal errors, memory exhaustion, repeated loopbacks, and plugin warnings can identify an application cause that the 504 page cannot show.
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
Debug logging should be temporary on a production site. Remove or restrict the settings after diagnosis, and prevent public access to the log because it may contain paths, queries, or other sensitive details.
Isolate WordPress application causes
Test the exact operation
Repeat only the failing screen, REST route, AJAX action, import, backup, or publishing job while watching the Nginx, PHP-FPM, and WordPress logs. A normal home page does not prove that an administrator operation is healthy; these requests can execute different hooks, queries, and remote calls.
Recommended Free Tools
Use a controlled plugin and theme test
Temporarily disable plugins and test with a default theme, preferably during a maintenance window or on a staging copy. If the timeout disappears, re-enable components one at a time until the request fails again. The component that makes the failure reproducible is a lead, not proof: inspect its queries, remote requests, and memory use before deciding how to fix it.
Look for common slow operations
- Database queries scanning large tables or waiting on locks.
- Remote API calls that do not return or are limited by their own service.
- Recursive loopbacks, where WordPress calls an endpoint on the same site and waits for itself.
- Large image, archive, export, or backup processing performed inside one web request.
- Exhausted PHP memory or a PHP-FPM pool with no free workers.
A 504 by itself cannot distinguish these cases. The request-specific log trail and a controlled reproduction are what establish the cause.
Choose the smallest safe configuration change
Raise a timeout only when the operation is legitimate, the logs show that the upstream is making progress, and the request repeatedly needs more time than the current limit. Change the directive that matches the path: proxy_read_timeout for proxy_pass, or fastcgi_read_timeout for PHP-FPM.
Apply the change to the narrowest location or request class that needs it. A long global timeout makes every stalled request consume a connection and potentially a PHP-FPM worker. It can conceal a broken plugin or unavailable service and delay detection of a real outage.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsAlign the limits across layers. The intended upper bound must be long enough for the legitimate operation but shorter than the point at which workers, load balancers, or users are harmed. If the platform owns an outer timer, an Nginx change below that layer will not alter the final result.
Example: a location-specific FastCGI timeout
Only use a configuration pattern like this after confirming that the request is handled by PHP-FPM and that a longer read window is justified:
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
location ~ .php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php-fpm.sock;
fastcgi_read_timeout 120s;
}
The socket path and surrounding parameters must match the host’s existing WordPress configuration. Do not paste a socket path from another distribution or PHP version without verifying it. The example changes the FastCGI read-gap timer for that location; it does not increase PHP memory, prevent PHP-FPM termination, or fix a slow database query.
Validate, reload, and reproduce
- Run
nginx -tand correct every syntax or include-file error before reloading. - Reload Nginx using the service manager your server uses, then confirm that the intended configuration is active.
- Repeat the exact URL, method, and operation that failed; do not substitute a faster page.
- Compare total request time and upstream response time in the logs before and after the change.
- Check PHP-FPM and WordPress logs for termination, memory, or application errors during the new attempt.
If the 504 still occurs at a precise interval, identify which layer owns that interval. Repeatedly changing unrelated directives creates configuration drift without changing the failing boundary.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Diagnose by symptom and scope
Every page fails after roughly the same interval
Check the front gateway, load balancer, Nginx upstream reachability, PHP-FPM availability, and host capacity. Confirm whether requests reach PHP-FPM at all. A site-wide pattern is unlikely to be fixed by disabling one plugin.
Only one admin, AJAX, or REST action fails
Capture that route and method, then inspect its WordPress hooks, database queries, remote calls, and payload size. Test plugins and the theme in isolation. A location-specific limit may be appropriate only after the operation is shown to be valid and progressive.
The failure happens at exactly 60 seconds
For a proxied path, 60 seconds matches the documented default for proxy_read_timeout. Confirm that the request really uses proxy_pass; a FastCGI location has a different directive. Also check for a 60-second limit at a load balancer or hosting layer.
The timeout interval varies with traffic
Investigate PHP-FPM worker saturation, CPU, memory pressure, database locks, and upstream service latency. Variable timing generally calls for capacity or application work, not a large universal timeout.
When managed hosting must intervene
Many managed WordPress plans do not expose global Nginx, PHP-FPM, or load-balancer configuration. Ask the host to inspect the relevant layer instead of repeatedly editing WordPress files.
Send a concise incident packet:
- UTC timestamp and timezone used.
- Full URL, HTTP method, and operation type.
- Whether all visitors or only one action is affected.
- The Nginx error-line excerpt, including the upstream or FastCGI socket.
- The matching PHP-FPM log excerpt and any WordPress
debug.logentry. - The repeatable duration and what changed before the failures began.
Ask which timer closed the connection, whether the upstream process completed or was terminated, and whether the host can provide timing-aware logs. This gives the provider enough context to distinguish an application defect from a platform limit.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Verify the fix and prevent recurrence
After the request succeeds, repeat it under the same conditions that caused the failure: the same route, payload size, user role, and database state. Confirm that the logs show a completed upstream response rather than merely a longer wait. Test a normal front-end page as well, because a narrowly scoped change should not degrade unrelated traffic.
For recurring operations such as imports, backups, or publishing, schedule them outside peak traffic, break very large jobs into batches, or move heavy work to a background process when the application supports it. Optimize slow queries and remove failing remote dependencies instead of retaining an ever-growing timeout.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Timing-aware access logs and external uptime or upstream-latency checks can alert you when response time rises before users see a 504. Monitor both total request time and upstream time so an edge or load-balancer delay is not confused with PHP execution time.
Key distinctions to remember
- A 504 is a boundary symptom; it does not prove that Nginx is the root cause.
proxy_read_timeoutapplies to proxied upstreams, whilefastcgi_read_timeoutapplies to PHP-FPM through FastCGI.- Nginx read timeouts measure inactivity between reads, not total response duration.
- PHP-FPM, PHP, database, external-service, and load-balancer limits can terminate or outlast the Nginx request.
- A modest, evidence-based, location-specific change is safer than a huge global timeout.
- When you cannot inspect server-level settings, provide the host with timestamps, URLs, methods, and log excerpts so it can identify the owning layer.
Frequently Asked Questions
Why does WordPress time out after 60 seconds?
Sixty seconds is the documented default for Nginx proxy_read_timeout on proxied requests, but another gateway may use the same interval. Confirm the request path and the log entry before changing it; FastCGI requests use fastcgi_read_timeout instead.
Should I increase proxy_read_timeout or fastcgi_read_timeout?
Use proxy_read_timeout only when the failing location uses proxy_pass. Use fastcgi_read_timeout when Nginx sends the request to PHP-FPM with fastcgi_pass. Neither setting fixes a PHP-FPM process, database query, or external API that has already failed.
Can a plugin cause a 504 even when Nginx is configured correctly?
Yes. Slow queries, remote API calls, recursive loopbacks, large media processing, memory exhaustion, and a saturated PHP-FPM pool can all delay a valid request. Reproduce the specific operation with plugins and the theme isolated, while checking the logs.
What should I do if I cannot edit Nginx or PHP-FPM settings?
Contact the hosting provider with the UTC timestamp, URL, method, operation type, Nginx error excerpt, PHP-FPM and WordPress log entries, and repeatable duration. Ask which layer ended the request and whether its limit or upstream service can be corrected.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

