Commands
Curated shell and tool commands for Linux, Windows, Python, Git, Django, SQL, and Nginx – searchable, filterable, and copyable with one click.
29 Commands found
No commands found. Try a different search or filter.
-
Nginx Bash
Break down DNS, TCP, TLS, and time-to-first-byte timings for a request
Requests https://example.com and prints five cumulative timing values measured by curl using its documented --write-out variables: time_namelookup (DNS resolution complete), time_connect (TCP handshake complete), time_appconnect (TLS handshake complete; 0 for plain HTTP), time_starttransfer (time to first byte of the response), and time_total (whole request). Each value is measured from the very start of the request, not as an isolated phase duration; subtract consecutive values (e.g. time_connect minus time_namelookup) to see how long an individual phase took. This is a more reliable way to see whether latency sits in DNS, connection setup, TLS, or the upstream/application behind nginx than guessing from response headers, which not every proxy sets. Performs an external network request.
curl -s -o /dev/null -w 'dns: %{time_namelookup}s, tcp: %{time_connect}s, tls: %{time_appconnect}s, ttfb: %{time_starttransfer}s, total: %{time_total}s\n' https://example.com -
Nginx Bash
Check for common security-related response headers
Fetches the response headers from https://example.com and filters them for Strict-Transport-Security, X-Frame-Options, and X-Content-Type-Options, three commonly recommended security headers. Performs an external network request; the absence of a match for one of these simply means that particular header is not set, which is itself useful diagnostic information, not an error.
curl -sI https://example.com | grep -Ei 'strict-transport-security|x-frame-options|x-content-type-options' -
Nginx Bash
Check Nginx configuration quietly
Test the configuration while suppressing non-error messages. Check the exit status; referenced files must be accessible. No reload is performed.
nginx -t -q -
Nginx Bash
Check the HTTP status code returned through a reverse proxy
Sends a request to https://example.com, discards the response body, and prints only the resulting HTTP status code, which is useful for confirming that a site behind an nginx reverse proxy responds as expected (e.g. 200 for a healthy upstream). Performs an external network request; replace example.com with the actual site being diagnosed.
curl -s -o /dev/null -w '%{http_code}\n' https://example.com -
Nginx Bash
Check whether nginx is enabled to start on boot
Prints whether the nginx systemd unit is enabled, disabled, static, or masked, i.e. whether it will start automatically on the next boot, independent of whether it is currently running. Read-only; requires systemd; the unit name is distribution-dependent.
systemctl is-enabled nginx -
Nginx Bash
Check whether ports 80 and 443 have an active listener
Uses ss's filter expression syntax to show only listening TCP sockets bound to source port 80 or 443, the standard HTTP and HTTPS ports, regardless of which process owns them. Read-only; a quick way to confirm something is listening on the expected web ports without needing to know the process name in advance.
ss -tln 'sport = :443 or sport = :80' -
Nginx Bash
Check whether the nginx service is currently active
Prints a single word (active, inactive, failed, ...) describing the current runtime state of the nginx systemd unit and sets the exit code accordingly, making it suitable for scripts and health checks without the verbose output of systemctl status nginx. Read-only; requires systemd and a service named nginx to exist, which is distribution-dependent (the unit is typically named nginx on Debian/Ubuntu-based systems).
systemctl is-active nginx -
Nginx Bash
Check which HTTP protocol version is actually negotiated
Sends a HEAD request using curl's dedicated -I/--head option (not -X HEAD, which only changes the request method text and is documented by curl as the wrong way to request headers-only) while asking curl to prefer HTTP/2 via --http2, then prints the response status line, which starts with the protocol version actually negotiated for this connection (e.g. "HTTP/2 200" or "HTTP/1.1 200 OK"). Requesting HTTP/2 only expresses a preference: it requires both curl to have been built with HTTP/2 support and the server to support it over TLS (via ALPN); if either side lacks support, curl falls back to HTTP/1.1, which is exactly why the negotiated version in the output must be checked rather than assumed from the flag alone. Performs an external network request.
curl -sI --http2 https://example.com -
Nginx Bash
Find recent server-error responses in the access log
Searches the access log for lines containing a 5xx HTTP status code (server errors such as 500, 502, 503) surrounded by spaces, then shows only the last 20 matches, which is useful for spotting recent upstream or application failures passed through nginx. Entries include client IP addresses and requested URLs, which can qualify as personal data; handle and share this output accordingly. Read-only; requires read access to the log file, which on Debian/Ubuntu packages typically means root/sudo or membership in the adm group; the exact log format and field order depend on the configured log_format directive.
grep ' 5[0-9][0-9] ' /var/log/nginx/access.log | tail -n 20 -
Nginx Bash
Follow all redirects and show the final effective URL
Starts at http://example.com, follows every redirect curl encounters (such as HTTP-to-HTTPS and a www-to-apex canonicalization), and reports how many redirect hops occurred along with the final URL actually reached. Performs an external network request; useful to verify an entire redirect chain in one call instead of inspecting each hop manually.
curl -s -o /dev/null -L -w '%{num_redirects} redirect(s), final: %{url_effective}\n' http://example.com -
Nginx Bash
Inspect Nginx service unit files
Show Nginx's systemd unit and drop-in files on disk without changing the service. They can contain secrets; do not share or log the output.
systemctl cat nginx --no-pager -
Nginx Bash
Inspect the complete Nginx configuration
Test and print the configuration, including included files. Output can contain secrets; inspect locally, never share or log it. File access is required.
nginx -T -
Nginx Bash
List certificates managed by Certbot and their expiry status
Lists every certificate Certbot currently manages on the local machine, including its domains, expiry date, and remaining validity, without renewing, revoking, or modifying any certificate. This is a local-only certificate inventory: it reads certificate and renewal configuration files under /etc/letsencrypt and normally does not contact any ACME server (unlike certbot renew). It does, however, write its own debug entry to Certbot's local log file (typically /var/log/letsencrypt/letsencrypt.log) on every invocation, including this read-only one. Requires Certbot to be installed and typically requires root/sudo privileges to read its configuration under /etc/letsencrypt.
certbot certificates -
Nginx Bash
List enabled nginx site configuration symlinks
Lists the symbolic links in /etc/nginx/sites-enabled, showing which site configurations are currently active without printing their contents. This sites-available/sites-enabled layout is the Debian/Ubuntu packaging convention (as used on this project's documented production server) and does not apply to RHEL/CentOS-style installations, which typically load configuration directly from conf.d instead. Read-only; may require read permission on /etc/nginx depending on its ownership.
find /etc/nginx/sites-enabled -maxdepth 1 -type l -
Nginx Bash
Measure the HTTP status code and total response time of a request
Requests https://example.com, discards the body, and prints the HTTP status code together with the total time curl took for the whole request. Useful as a quick combined health and latency check. Performs an external network request; timing includes DNS lookup, connection, TLS handshake, and transfer.
curl -s -o /dev/null -w 'HTTP %{http_code} in %{time_total}s\n' https://example.com -
Nginx Bash
Read today's Nginx service journal
Read accessible Nginx systemd journal entries since local midnight without a pager. This is not the Nginx access log; treat log contents as private.
journalctl -u nginx --since today --no-pager -
Nginx Bash
Show listen directives across enabled site configurations
Recursively searches /etc/nginx/sites-enabled for lines that consist of the listen directive at the start of a line (ignoring leading whitespace, matched with a documented POSIX character class instead of a locale-specific shorthand), printing the file name, line number, and the matching text. Because sites-enabled conventionally holds symlinks to files in sites-available, grep's -R (as opposed to plain -r, which only follows symlinks given directly on the command line) is required here so that the content of those linked files is actually searched rather than being skipped. This sites-available/sites-enabled layout is the Debian/Ubuntu packaging convention (as used on this project's documented production server) and does not apply to RHEL/CentOS-style installations, which typically load configuration directly from conf.d instead. Read-only; may require read permission on /etc/nginx depending on its ownership.
grep -RnE '^[[:space:]]*listen[[:space:]]' /etc/nginx/sites-enabled/ -
Nginx Bash
Show Nginx version
Prints the installed Nginx version to standard error.
nginx -v -
Nginx Bash
Show nginx version and build configuration details
Prints the nginx version together with the full configure-time build arguments, compiled-in modules, and the version of the TLS library it was built against. This is distinct from the lowercase nginx -v, which only prints the version number. Read-only; requires nginx to be installed and on PATH; no special privileges needed.
nginx -V -
Nginx Bash
Show the full set of HTTP response headers
Sends a request to https://example.com and prints only the HTTP response headers (status line, Content-Type, caching headers, security headers, etc.) without the response body. Performs an external network request; does not modify anything on the local machine, though whether the remote server itself treats this as side-effect-free depends on that server's own implementation, as with any HTTP request.
curl -sI https://example.com -
Nginx Bash
Show the HTTP status and target of a redirect
Requests http://example.com without following redirects, then prints the status code (typically 301 or 302 if nginx redirects HTTP to HTTPS) together with the Location header it would redirect to. Performs an external network request; if the server does not redirect, redirect_url will be empty.
curl -s -o /dev/null -w '%{http_code} -> %{redirect_url}\n' http://example.com -
Nginx Bash
Show the most recent nginx access log entries
Prints the last 50 lines of the nginx access log at its default Debian/Ubuntu path. Each line typically includes the client's IP address, requested URL, user agent, and referrer, which can qualify as personal data under privacy regulations such as the GDPR; handle and share this output accordingly. Read-only with respect to the log file; on Debian/Ubuntu packages the log directory is normally owned by root with group adm and is not readable by arbitrary users, so this typically requires root/sudo or membership in that group, though exact ownership and permissions can differ on other distributions or custom setups.
tail -n 50 /var/log/nginx/access.log -
Nginx Bash
Show the most recent nginx error log entries
Prints the last 50 lines of the nginx error log at its default Debian/Ubuntu path, showing recent configuration warnings, upstream connection failures, and similar operational problems. Entries can include client IP addresses and sometimes fragments of request data, which may qualify as personal or sensitive information; handle and share this output accordingly. Read-only with respect to the log file; on Debian/Ubuntu packages this file is normally owned by root with group adm, so it typically requires root/sudo or group membership for read access, though this can differ on other distributions or custom setups.
tail -n 50 /var/log/nginx/error.log -
Nginx Bash
Show the most recent systemd journal entries for nginx
Prints the last 50 journald log lines recorded for the nginx systemd unit, covering service start/stop/reload events and anything nginx wrote to standard error at startup, without opening the interactive pager. These entries generally contain less client-identifying detail than the access or error logs, but can still include request-related data depending on configuration; handle accordingly. Read-only; requires systemd and typically sufficient privileges to read the journal (membership in the systemd-journal group or root/sudo).
journalctl -u nginx -n 50 --no-pager -
Nginx Bash
Show the nginx command-line help
Prints nginx's built-in command-line usage summary, listing every supported startup option (such as -t, -T, -s, -g, -c, -p) with a short description of each. Read-only; requires nginx to be installed and on PATH; no special privileges needed.
nginx -h -
Nginx Bash
Show the subject, issuer, and validity dates of a site's TLS certificate
Connects to example.com on port 443 using openssl s_client with SNI set via -servername, pipes the retrieved certificate into openssl x509, and prints only its subject, issuer, and notBefore/notAfter validity dates, without dumping the full certificate or any private key material (none is ever transmitted by the server in a normal TLS handshake). Performs an external network connection; requires the openssl command-line tool to be installed.
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates -
Nginx Bash
Show which TCP ports nginx is actively listening on
Lists listening TCP sockets with their owning process (via ss -tlnp) and filters the output to lines mentioning nginx, showing the actual ports the running nginx master/worker processes are bound to right now, as opposed to what the configuration merely declares. Read-only; the -p flag to show process names/PIDs typically requires root or sudo privileges.
ss -tlnp | grep nginx -
Nginx Bash
Test whether a site accepts a TLS 1.2 connection
Connects to example.com on port 443 and explicitly requests a TLSv1.2 client hello using openssl s_client's documented -tls1_2 option, combined with -brief (supported since OpenSSL 1.1.1) to print a concise summary instead of the full certificate dump. Unlike filtering the full output with grep for ad hoc keywords such as "Protocol" or "Cipher", which can still match on a failed handshake (for example a stub "Cipher is (NONE)" line) and make success and failure easy to confuse, -brief is purpose-built to report the negotiated protocol, cipher, and any handshake error clearly in one short summary. If the server does not support TLS 1.2, the connection fails and the summary shows the handshake error instead of a negotiated protocol/cipher. Performs an external network connection; requires openssl; reveals only protocol and cipher negotiation details, no private key or other sensitive certificate content.
echo | openssl s_client -connect example.com:443 -servername example.com -tls1_2 -brief 2>&1 -
Nginx Bash
Validate Nginx configuration
Tests the Nginx configuration files for syntax errors without reloading the service. Requires appropriate permissions.
nginx -t