Guance Learn

Observability questions

Focused answers for definitions, architecture choices, troubleshooting, pricing, and evaluation.

Illustration of server operations and request logs
Explainer

Understand Nginx location matching order

Trace exact, prefix, and regex location selection, including the limits of the usual flat-configuration rule.

Illustration of server operations and request logs
Explainer

Why Nginx has no sites-available directory

Find the include layout used by your Nginx installation and add site configuration without relying on a distribution-specific convention.

Illustration of server operations and request logs
Explainer

Redirect www to non-www, or non-www to www, with Nginx

Choose a canonical hostname, preserve paths and queries, and cover HTTP and HTTPS entry points without creating a redirect loop.

Illustration of server operations and request logs
Explainer

Get the correct client IP behind trusted proxies in Nginx

Configure real-IP trust boundaries, understand recursive X-Forwarded-For parsing, and test spoofed headers from untrusted clients.

Illustration of server operations and request logs
Explainer

Troubleshoot 504 Gateway Timeout responses from an Nginx proxy

Identify which upstream operation timed out, align request deadlines, and use backend evidence before increasing proxy timeouts.

Illustration of server operations and request logs
Explainer

Serve a single-page application with an Nginx HTML fallback

Use try_files for frontend routes while preserving real asset errors, API responses, and predictable caching.

Illustration of server operations and request logs
Explainer

Use wildcard and catch-all server names in Nginx

Match subdomains, capture tenant names, and configure a default listener without confusing Nginx wildcards with TLS certificates.

Illustration of server operations and request logs
Explainer

Stop Nginx from serving PHP source as a download

Configure the PHP-FPM handler, prevent unintended script execution, and distinguish source exposure from an application-generated download.

Illustration of server operations and request logs
Explainer

Troubleshoot “nginx.service failed because the control process exited”

Read the underlying Nginx and systemd errors, then check configuration, port ownership, file access, and service startup options.

Illustration of server operations and request logs
Explainer

Diagnose blank PHP pages behind Nginx

Inspect the HTTP response and PHP-FPM logs, verify script paths, and expose errors only in a controlled development environment.

Illustration of server operations and request logs
Explainer

Fix Nginx “stat() failed (13: Permission denied)”

Locate the inaccessible directory or security-policy denial, then grant the worker only the access required to serve the file.

Python programming and application logging
Explainer

Read a file line by line in Python

Iterate over a text file with a context manager, preserve meaningful whitespace, and handle encoding and long-line memory limits.