Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk10 min

How to Troubleshoot Common Website Issues on a Linux Server

Diagnose a Linux-hosted website methodically: check systemd units, read complete journals and nginx errors, verify the backend listener, and apply targeted fixes for 502, 503 and 504 responses.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the service status, then read the complete systemd journal for the web server and its backend. Next, inspect nginx’s error log, verify that the upstream is listening, and use the HTTP status code to choose the least risky fix. This sequence separates a stopped service, a broken upstream connection, an intentional limit, and a slow application without guessing.

Use a fixed triage order

A website failure on a Linux server is usually visible in one of three places: the systemd unit that launches a service, nginx’s request/error logs, or the application service behind nginx. Checking those layers in order prevents a common mistake: changing nginx settings when the backend is stopped, or restarting a healthy web server when the application is the component failing.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Check nginx and the backend unit. Run sudo systemctl status nginx, followed by the status command for the backend, such as sudo systemctl status php-fpm. Read the Result field and the recent lines shown at the bottom. Those lines are only a short excerpt, so do not treat them as the complete diagnosis.
  2. Read the full unit journal. Run sudo journalctl -u nginx. Narrow the time range when the failure is recent: sudo journalctl -u nginx --since "5 minutes ago". After a reboot or restart, inspect the previous boot with sudo journalctl -u nginx -b -1. To show only error-priority entries from the current boot, use sudo journalctl -u nginx -b -p err.
  3. Inspect nginx’s error log. The commonly used path is /var/log/nginx/error.log; use the path configured by your server if it differs. Match the error text and timestamp to the request that failed.
  4. Confirm the upstream is listening. Run ss -tlnp and check that the expected backend address, port, or Unix socket is present. Then read the backend’s own recent entries, for example sudo journalctl -u <app-service> --since "5 minutes ago".
  5. Apply the smallest change indicated by the evidence. That may mean restarting a stopped backend, correcting access to its socket, changing an operating-system policy, or adjusting a timeout for a genuinely slow response. Re-test and immediately check the logs again.

Run commands with sudo only when needed. Record the original error and the time of each change; this makes it possible to undo a change that does not help.

What the main HTTP errors mean

The status code is a routing clue, not a complete diagnosis. The same code can have several causes, so always confirm it against the nginx and service logs.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Status What nginx is telling the browser First evidence to collect Typical fault location
502 Bad Gateway Nginx could not connect to the upstream, received an invalid response, or the upstream closed the connection before completing it. The nginx error-log line, then backend status and listener output from ss -tlnp. Backend process, socket/port, permissions, or an operating-system policy blocking the connection.
503 Service Unavailable Nginx is refusing the request because a configured rate or connection limit was reached; it is not automatically evidence that the backend crashed. Error-log entries containing “limiting requests,” the client IP, and the affected limit zone. Nginx limit configuration or traffic pattern; investigate the backend only if the logs point there.
504 Gateway Timeout Nginx connected to the upstream but did not receive the next part of the response before the configured read timeout expired. The request time, backend logs, and the effective proxy_read_timeout in the matching nginx block. Slow or stuck application, overloaded backend, or a timeout that is shorter than the application’s legitimate response time.

Diagnose a 502 Bad Gateway

Check whether the backend is running

A stopped PHP-FPM service is a common example. Check it directly with sudo systemctl status php-fpm. If the unit is failed or inactive, read its journal before restarting: sudo journalctl -u php-fpm --since "5 minutes ago". The log may show a crash, a configuration error, or memory exhaustion. Restarting can restore service, but it does not explain why the unit stopped; preserve the failure details before they roll out of the short status excerpt.

Use your actual unit name when the application is not PHP-FPM. A generic command is sudo systemctl status <backend>, followed by sudo journalctl -u <backend> --since "5 minutes ago". If the unit starts and then exits again, treat that as an application or resource problem rather than an nginx problem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the listener, port, or Unix socket

Run ss -tlnp and compare its output with the upstream address in the nginx configuration. A TCP upstream should have a listening process on the expected address and port. A FastCGI or other local backend may use a Unix socket instead. If nothing is listening, nginx cannot establish the upstream connection and will commonly log a connection-refused message such as connect() failed (111: Connection refused).

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

When the backend listens on a socket, check that the nginx worker user can reach that socket. A user or group mismatch can produce a 502 even while the backend process is healthy. The exact ownership and mode must match the account running nginx and the account or group that owns the socket. Make the correction in the backend’s service or pool configuration so it survives a restart; changing a socket manually is usually temporary.

Separate malformed responses from connection failures

A 502 also occurs when the upstream answers with data nginx cannot accept, or closes the connection before sending a complete response. The nginx error-log wording distinguishes this from a refusal to connect. Use the timestamp to find the corresponding backend entry. If the backend log shows a crash or forced termination at the same moment, fix that event first. If nginx reports an invalid upstream response while the backend remains running, inspect the application’s output and its protocol configuration rather than raising a timeout.

Check SELinux on RHEL-family systems

On systems using SELinux, the policy can prevent nginx from making a network connection to an upstream even when the process and port look correct. Check the relevant boolean with getsebool httpd_can_network_connect. If the policy is denying the connection, follow your distribution’s approved SELinux procedure and record the policy change. Do not disable SELinux broadly as a first response; confirm the denial and allow only the required operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Diagnose a 503 Service Unavailable

Look for an intentional nginx limit

Nginx can deliberately return 503 when a configured request-rate or connection limit rejects traffic. In that case, the error log records “limiting requests” together with the offending IP and the name of the limit zone. This is a useful distinction: restarting PHP-FPM or increasing an application timeout will not remove a limit enforced before the request reaches the backend.

Capture several log lines around the event. If the same client address repeatedly triggers the same zone, review the limit’s intended capacity and scope. A limit may be protecting the server from bursts, or it may be too restrictive for a legitimate workload. Change it only after confirming which zone is involved, then watch the error log while reproducing the request.

When a 503 does point beyond nginx

If the error log does not show a limiting message, inspect the unit status and backend journal using the triage sequence. A backend can return an application-level 503, and the application log will identify that condition. Keep the two cases separate: an nginx-generated 503 is a traffic-control decision, while an application-generated 503 is a response from the upstream service.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Diagnose a 504 Gateway Timeout

Understand the 60-second default

Nginx’s default proxy_read_timeout is 60 seconds. The setting measures the maximum gap between successive reads from the upstream; it is not a cap on the total time from request start to response completion. A WebSocket connection is also closed by default when the proxied server sends no data within that interval.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Therefore, a request that takes 70 seconds but sends data every 20 seconds can remain connected, while a request that sends nothing for 61 seconds can time out even if its eventual computation would have finished. This distinction matters when deciding whether a timeout change is appropriate.

Determine whether the application is genuinely slow

Match the 504 timestamp with the backend journal: sudo journalctl -u <app-service> --since "5 minutes ago". Look for a long-running operation, a blocked worker, a crash, or memory exhaustion. Check whether other requests are completing normally. If the backend is overloaded or stuck, fix that condition instead of masking it with a larger nginx timeout.

Change the timeout only when the workload requires it

If the backend is healthy and the operation legitimately has a long silent interval, set an appropriate proxy_read_timeout in the nginx block that handles the request. Keep the value as small as the workload allows; a very large value can tie up connections while an upstream is unavailable. After editing, validate and reload nginx using your distribution’s normal configuration-check and reload procedure, then confirm the effective block is the one serving the request.

An nginx ticket, #1471, documented a report of a 504 after 45 seconds even though a timeout override appeared to exist. The report was closed as invalid, and the reported workaround was to place the setting in the location block that actually matched the request. If an override appears ignored, inspect inheritance and the selected location rather than assuming nginx discarded the directive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Read logs without losing the useful context

Why systemctl status is not enough

systemctl status is a fast health check. Its bottom lines are a recent excerpt, not the complete unit record. A service may have failed during an earlier restart, recovered, and then failed again; only the journal shows that sequence. Use journalctl -u nginx for the full unit history, and apply --since, -b -1, or -p err to focus the search.

Correlate three timestamps

  • The browser or monitoring timestamp for the failed request.
  • The nginx error-log timestamp and status code.
  • The backend or systemd journal timestamp.

If the nginx entry appears without a corresponding backend event, the request may have been rejected by nginx itself or blocked before reaching the application. If all three align, the backend log usually contains the most actionable cause.

Read the complete error message

Copy the entire nginx line, including the upstream address, error number, client address, and request path. “Connection refused,” “timed out,” and “invalid response” lead to different checks. Searching only for the three-digit status code discards the detail that identifies the failing boundary.

Choose the least risky corrective action

Evidence Action to try first Why this is the safer choice
Backend unit is inactive or failed Read its journal, correct the reported cause, then restart that backend. It addresses the component that is unavailable instead of changing proxy behavior.
Connection refused and no listener in ss -tlnp Start or repair the backend and verify its configured port/socket. Nginx cannot connect to a service that is not listening.
Socket access denied Correct the backend socket’s user/group or mode in its persistent configuration. A manual permission change may disappear on the next restart.
SELinux denial on a RHEL-family host Confirm the denial and adjust the specific boolean or policy rule required. It preserves mandatory access control rather than disabling it globally.
503 with “limiting requests” Review the named rate or connection zone and its intended capacity. The request is being rejected intentionally at nginx.
504 with a healthy but slow upstream Optimize the operation first; increase proxy_read_timeout only for the matching location when the delay is legitimate. A larger timeout does not cure a crashed or overloaded backend.

A repeatable recovery runbook

  1. Save the symptom. Note the URL, status code, approximate time, and whether all pages or only one operation fail.
  2. Check both units. Run sudo systemctl status nginx and the relevant backend status command.
  3. Pull focused journals. Use sudo journalctl -u nginx --since "5 minutes ago" and the equivalent backend command. If the incident followed a reboot, add -b -1 to inspect the previous boot.
  4. Inspect the nginx error log. Find the matching timestamp and copy the complete line.
  5. Map the evidence to 502, 503, or 504. Use the distinctions above; do not infer a backend crash from a 503 limit message.
  6. Verify connectivity. Run ss -tlnp; check the configured port or socket and its access permissions.
  7. Inspect the backend journal. Look for crashes, exits, malformed output, or resource exhaustion at the same time.
  8. Apply one targeted change. Restart a failed unit, repair socket access, adjust the relevant SELinux control, or change a location-level timeout only when justified.
  9. Re-test and re-read logs. A successful page load is not proof that the cause is fixed; confirm that new requests no longer produce the original error.
  10. Document the final state. Record the changed setting, the service restarted, and the evidence that the error stopped.

Common troubleshooting mistakes

  • Restarting nginx first every time. This can erase the timing of a backend failure without correcting it.
  • Using only the last lines from systemctl status. The excerpt can omit the original failure.
  • Treating every 503 as an outage. Check for nginx’s “limiting requests” entry before touching the backend.
  • Raising a timeout to hide a crash. A timeout helps only when the upstream is functioning but legitimately pauses between reads.
  • Editing the wrong nginx context. A directive in an unused server or location block cannot affect the failing request.
  • Changing socket permissions by hand. A service restart may recreate the socket with the old ownership; fix the persistent backend configuration.
  • Disabling SELinux globally. Confirm the specific denial and make the narrow policy change required.
  • Making several edits at once. Multiple simultaneous changes remove the evidence needed to identify the effective fix.

What a successful diagnosis looks like

You should be able to state the failing boundary in one sentence: for example, “nginx returned 502 because the PHP-FPM socket had no listener,” “nginx returned 503 because the configured request zone limited this client,” or “nginx returned 504 because the application left the upstream silent for longer than the 60-second read timeout.” That statement ties the browser symptom to a log line and a service-level observation. If you cannot make that connection, gather the full journal and error-log context before changing configuration.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.