All tags
Start here · nginx🛜 Guide: AdGuard Home + Tailscale (Secure Split-Horizon DNS)10 steps · 4 min read · Home lab users with AdGuard Home and TailscaleStart the guide nginx
Narrow down
Guides1
Network39
- Tip
/data/nginx/custom/server_redirect.confServer_redirect.conf adds nginx lines to every redirection host in Nginx Proxy ManagerA custom file that Nginx Proxy Manager includes at the end of every redirection server block.2 Dec 2026 - Tip
map $http_upgrade $connection_upgrade {A map on $http_upgrade lets one nginx location serve WebSockets and normal requestsSends Connection upgrade only when the client asks for it, and close otherwise.30 Nov 2026 - Tip
proxy_intercept_errors on;proxy_intercept_errors lets nginx show its own error page for a failing backendReplaces backend 502, 503 and 504 responses with a friendly page that nginx serves itself.30 Nov 2026 - Tip
proxy_redirect http://localhost:3000/ /app/;Nginx proxy_redirect fixes redirects that point to the backend's own addressRewrites Location headers from a backend so redirects stay on your public domain.30 Nov 2026 - Tip
sub_filter 'http://127.0.0.1:8081/' 'https://example.com/app/';Nginx sub_filter rewrites text in a proxied page on the flyReplaces strings in HTML from a backend, like hardcoded internal URLs, before it reaches the browser.30 Nov 2026 - Tip
map $request_uri $new_uri {One nginx map handles a long list of old URLs to redirectKeeps hundreds of old-to-new redirects in one lookup table instead of many location blocks.30 Nov 2026 - Tip
location /protected/ {X-Accel-Redirect lets your app check access and nginx send the fileLets a backend approve a download and hand the actual file transfer to nginx.30 Nov 2026 - Tip
location /api/public/ {Nginx limit_except allows only the HTTP methods a location needsBlocks POST, PUT and DELETE on paths that should only ever be read.30 Nov 2026 - Tip
upstream app {Nginx proxy_next_upstream retries a failed request on the next backendTells nginx which errors should send a request on to another upstream server.30 Nov 2026 - Tip
proxy_connect_timeout 3s;A short nginx proxy_connect_timeout fails over fast when a backend is downStops nginx from waiting a full minute to connect to a backend that is not there.30 Nov 2026 - Tip
proxy_hide_header X-Powered-By;Nginx proxy_hide_header strips backend headers like X-Powered-ByRemoves headers that reveal backend software versions before responses reach the client.30 Nov 2026 - Tip
proxy_cache app;Proxy_cache_use_stale keeps nginx serving pages while the backend is downServes the last cached copy of a page when the backend errors out or is busy refreshing.30 Nov 2026 - Tip
limit_rate_after 500k;Nginx limit_rate_after lets a download start fast and then slows it downThrottles big downloads per connection after the first part, so small files stay quick.30 Nov 2026 - Tip
return 200 "ok\n";A location with return 200 gives nginx its own health check URLAdds a tiny endpoint that answers ok without touching any backend or file.30 Nov 2026 - Tip
limit_conn addr 1;Nginx limit_conn caps simultaneous connections per IP addressLimits how many connections one IP address may keep open at once.28 Nov 2026 - Tip
server {A default_server with return 444 drops requests for unknown host namesCloses the connection for requests whose host name matches none of your sites.28 Nov 2026 - Tip
location /i/ {Nginx root adds the location to the path, alias replaces itExplains which file path nginx builds with root and with alias, so static files stop returning 404.27 Nov 2026 - Tip
location = /basic_status {Nginx stub_status gives you a live connection count on one URLShows how many connections nginx has open and what they are doing, on a small status page.27 Nov 2026 - Tip
upstream app_backend {Nginx keepalive in an upstream block reuses connections to your backendKeeps a few connections from nginx to the backend open for reuse instead of reconnecting per request.27 Nov 2026 - Tip
include conf.d/include/block-exploits.conf;Block Common Exploits in Nginx Proxy Manager is a list of regexes, and it can block your own appExplains what the Block Common Exploits switch blocks and why it can cause a 403 in your app.27 Nov 2026 - Tip
load_module /usr/lib/nginx/modules/ngx_http_geoip2_module.so;Nginx Proxy Manager ships the geoip2 module, so you can allow only Dutch visitorsBlocks visitors from outside the countries you choose on selected Nginx Proxy Manager hosts.27 Nov 2026 - Tip
allow 192.168.1.0/24; allow 10.8.0.2;Nginx allow and deny stop at the first match, so deny all goes lastRestricts a path to chosen addresses and refuses everyone else.24 Nov 2026 - Tip
location /upload/ {Nginx client_max_body_size is 1m by default, so scope the raise to one locationRaises the 1 MB upload limit for one path and keeps it low everywhere else.24 Nov 2026 - Tip
upstream app {Nginx upstream max_fails and fail_timeout drop a dead backend automaticallyTakes a failing backend out of rotation for a while and uses a spare server meanwhile.24 Nov 2026 - Tip
proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme;Nginx proxy_set_header Host $host stops backends from seeing 127.0.0.1Forwards the original host name and scheme to the application behind the proxy.24 Nov 2026 - Tip
location ^~ /uploads/ { root /var/www; }^~ in a nginx location stops regex locations from taking the requestMakes a prefix location final so no regex location can take over its requests.24 Nov 2026 - Tip
return 301 https://example.com$request_uri;Nginx return 301 beats rewrite for plain redirectsSends a permanent redirect that keeps the path and query string, without a regex.24 Nov 2026 - Tip
location /app/ { proxy_pass http://127.0.0.1:3000; } # backend sees /app/pageA trailing slash on nginx proxy_pass changes the path the backend seesShows how the slash at the end of proxy_pass strips or keeps the location prefix.24 Nov 2026 - Tip
set_real_ip_from 192.168.1.0/24;Tell Nginx which proxy to trust, so your apps see the real client IPMakes nginx read the real visitor address from a header when another proxy sits in front.1 Oct 2026 - Tip
proxy_read_timeout 1h;Nginx closes a quiet WebSocket after 60 secondsKeeps quiet WebSocket connections open longer than the 60 second default.17 Sep 2026 - Tip
limit_req_zone $binary_remote_addr zone=npmlimit:10m rate=10r/s;Rate limit your proxy hosts with http_top.conf and server_proxy.confLimits how many requests per second one client can send to your Nginx Proxy Manager hosts.16 Jul 2026 - Tip
client_max_body_size 10g;Raise the 413 upload limit for every proxy host with server_proxy.confRaises the upload size limit on all Nginx Proxy Manager proxy hosts, so big uploads stop failing with 413.8 Jul 2026 - Tip
server_tokens off;server_tokens off hides the nginx version from headers and error pagesRemoves the nginx version number from the Server header and error pages.5 May 2026 - Tip
access_log /var/log/nginx/access.log combined if=$loggable;Nginx access_log with if= keeps health checks out of the logSkips chosen requests, such as health checks, when writing the access log.4 May 2026 - Tip
log_format timed '$remote_addr "$request" $status $body_bytes_sent 'Nginx log_format with $request_time shows which requests are slowAdds request and upstream timing to each access log line.4 May 2026 - Tip
add_header X-Content-Type-Options nosniff always; # server blockadd_header inside a nginx location drops the headers from the server blockExplains why headers set in the server block disappear inside a location with its own add_header.3 May 2026 - Tip
expires 30d;Nginx expires 30d sets browser caching for static files in one lineTells browsers to keep static files for 30 days and skip repeat downloads.3 May 2026 - Tip
location = /login { limit_req zone=login burst=5 nodelay;Nginx limit_req slows brute-force attempts on a login pageLimits how often one client address may request a path and returns 429 beyond that.3 May 2026 - Tip
add_header Cache-Control "public, max-age=31536000, immutable";Cache-Control: immutable stops revalidation of a cache-busted fileMarks fingerprinted files as never changing so browsers skip revalidation on reload.5 Apr 2026
Shell7
- Tip
sudo certbot --nginx -d example.com -d www.example.comCertbot --nginx gets a certificate and wires it into your server blockGet a Let's Encrypt certificate and enable it in nginx with one command3 Dec 2026 - Tip
printf 'admin:%s\n' "$(openssl passwd -apr1)" | sudo tee -a /etc/nginx/htpasswdOpenssl passwd makes an nginx password file without apache2-utilsCreates an htpasswd line with openssl and puts a password on one nginx location.30 Nov 2026 - Tip
sudo nginx -t -c /tmp/stage/nginx.confNginx -t -c tests a new config file before it replaces the live oneChecks a staged nginx.conf for errors while the running config stays untouched.30 Nov 2026 - Tip
nginx -V 2>&1 | tr ' ' '\n' | grep -- --with-nginx -V lists the modules your build has before you use a directiveShows the configure flags and modules of the installed nginx binary.24 Nov 2026 - Tip
sudo nginx -s reloadNginx -s reload lets old workers finish their requests, a restart does notApplies a changed configuration while connections that are in progress finish normally.24 Nov 2026 - Tip
sudo nginx -t && sudo systemctl reload nginxNginx -t checks your config before you reloadTests the nginx configuration for errors, so a typo does not take your sites down.23 Nov 2026 - Tip
sudo nginx -T | lessNginx -T prints the whole merged config, every include file in one goPrints the complete configuration nginx would load, with each included file marked.2 May 2026
Docker4
- Tip
server {The nginx image fills in environment variables from /etc/nginx/templatesWrites config from templates with your environment values when the official container starts.30 Nov 2026 - Tip
upstream app {The resolve parameter keeps nginx starting when a container name does not resolve yetLooks up upstream host names at run time so nginx starts even when a backend is missing.30 Nov 2026 - Tip
services:Mount your own logrotate file in Nginx Proxy Manager when access logs growReplaces the default weekly log rotation of Nginx Proxy Manager with your own file.28 Nov 2026 - Tip
proxy_timeout 1h;Nginx streams drop idle connections after ten minutesKeeps idle TCP and UDP streams open longer than the ten minute default.6 Oct 2026
CSS2
- Tip
gzip -k -9 dist/app.css dist/app.jsNginx gzip_static serves your precompressed .gz files instead of compressing on every requestSends ready-made .gz versions of static files, compressed once at maximum level.30 Nov 2026 - Tip
gzip on;Nginx gzip_types is the line that makes JSON and CSS compressCompresses CSS, JavaScript and JSON responses, which nginx skips by default.3 May 2026
Media1
Web1
Nothing matches.