Guides tagged “nginx”
Step-by-step MdmHost guides about nginx, sorted A-Z.
52 guides · page 1 of 3
Add free SSL (HTTPS) to a Node.js app
Secure a Node.js app with free SSL: AutoSSL on cPanel, or Let's Encrypt with Certbot on an Nginx or Apache reverse proxy, plus redirects and trust proxy.
Add security headers in Nginx (HSTS, CSP, X-Frame-Options)
Add the HTTP security headers browsers use to protect your visitors, including HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy and a starter Content Security Policy.
Advanced Nginx load balancing with upstream directives
Use Nginx upstream blocks to spread traffic across several backends: pick a balancing method, set weights and backups, tune passive health checks and keep connections alive.
Allow or block IP addresses in Nginx
Use Nginx allow and deny rules to keep admin areas to your own IP, block abusive addresses and whole ranges, manage long lists in include files, and choose between 403 and 444.
Configuring advanced caching layers with Varnish on top of Nginx
Put Varnish in front of Nginx as an HTTP accelerator: install it, write a VCL that caches the right pages, terminate TLS in Nginx and confirm real cache hits.
Customise web server configuration per domain in DirectAdmin (admin)
Use DirectAdmin's Custom HTTPD Configurations to add Apache, Nginx or OpenLiteSpeed directives for one domain, use CUSTOM tokens and templates, and keep changes upgrade-safe.
Deploy a Next.js app on a Linux VPS (next start or standalone)
Build and run a Next.js app in production on a Linux VPS with next start or the smaller standalone output, keep it alive with PM2 and serve it through Nginx.
Deploy a Node.js app with PM2 behind Nginx
Install a Node.js LTS release, keep your app running with PM2 across crashes and reboots, and serve it through Nginx with HTTPS.
Deploy a Python app with Gunicorn, systemd and Nginx
Set up a virtual environment, run your Flask or Django app with Gunicorn as a systemd service, and serve it through Nginx with HTTPS.
Docker Compose for WordPress: Nginx, PHP-FPM and MariaDB
Build a WordPress stack with Docker Compose using separate Nginx, PHP-FPM and MariaDB containers, a persistent wp-content volume and a free Let's Encrypt certificate.
Enable Brotli compression in Nginx
Add Brotli compression to Nginx with the packaged dynamic modules on Ubuntu 24.04 and Debian 12, keep gzip as a fallback, and confirm browsers receive br encoding.
Enable gzip compression in Nginx
Turn on gzip in Nginx so HTML, CSS, JavaScript and JSON are sent compressed, choose sensible types and levels, and confirm it works with curl.
Enable NGINX with reverse proxy on cPanel
Install cPanel's ea-nginx as a caching reverse proxy in front of Apache, control caching per account, clear the cache and fix 502 Bad Gateway errors.
Fix 403 Forbidden in Nginx
Nginx returns 403 Forbidden when it will not serve a file or folder. Work through the usual causes, from a missing index file to permissions, deny rules and SELinux.
Fix 502 Bad Gateway in Nginx
A 502 Bad Gateway means Nginx could not get a valid answer from PHP-FPM or your app. Read the error log, then check the backend service, socket path, permissions and ports.
Fix 504 Gateway Timeout in Nginx
A 504 Gateway Timeout means PHP or your app took longer to answer than Nginx was willing to wait. Find the slow request, raise the right timeouts consistently, and fix the root cause.
Fix ERR_TOO_MANY_REDIRECTS: diagnose a redirect loop
Trace an ERR_TOO_MANY_REDIRECTS loop across Nginx, Apache, WordPress and Cloudflare, and find the single rule that keeps sending traffic back to itself.
Fix Nginx 404 errors with try_files for pretty URLs
Pretty URLs return 404 on Nginx when nothing routes them to your app. Add the right try_files line for WordPress, Laravel or a single-page app, and avoid root and alias mistakes.
Fix Nginx 413 Request Entity Too Large
Nginx returns 413 Request Entity Too Large when an upload is bigger than client_max_body_size. Raise the limit for one site or the whole server, match PHP's limits, and test.
Fix Nginx failed to start: address already in use
Nginx will not start when another program already holds port 80 or 443. Find what is using the port with ss, stop or move it, fix duplicate listen lines, then start Nginx.
Browse by topic
- Getting startedYour first hour with a new server: access, logins and basics.69 guides
- cPanelFiles, databases, email, domains and every cPanel tool, step by step.37 guides
- WHM & resellingWHM, packages, reseller accounts, WHMReseller and running a hosting brand.49 guides
- WordPressInstall, secure, speed up, migrate and fix WordPress sites.40 guides
- Email & webmailMailboxes, webmail, forwarders, spam filters and email delivery.37 guides
- DomainsRegistering, transferring and managing domains and nameservers.20 guides
- SSL certificatesFree AutoSSL, Let's Encrypt, paid certificates and HTTPS.19 guides
- CloudLinuxCloudLinux setup and use: LVE limits, CloudLinux Manager, CageFS and PHP/Node.js selectors.31 guides
- LiteSpeedLiteSpeed Web Server, LSCache and the LiteSpeed Cache plugin: install, settings and tuning.30 guides
- Imunify360Malware scanning, firewall and proactive defence with Imunify360.23 guides
- SoftaculousInstall, update, clone and back up apps with Softaculous.23 guides
- WP SquaredcPanel's WordPress platform: sites, plugins, staging and backups.9 guides
- SitePadBuild and publish websites with the SitePad builder.9 guides
- SitejetDesign, edit and publish sites with the Sitejet builder.9 guides
- WHMResellerAlpha and master resellers with WHMReseller: install, setup and use.12 guides
- VirtFusionInstall, set up and manage VirtFusion: hypervisors, packages, servers and WHMCS integration.7 guides
- VirtualizorManage your VPS with Virtualizor: power, OS reinstall, VNC, IPs and backups.30 guides
- PleskWebsites, email, databases and settings in the Plesk panel.52 guides
- DirectAdminUsers, domains, email and reseller tools in DirectAdmin.40 guides
- WHMCSBilling, automation, products and client management with WHMCS.51 guides
- Control panelscPanel & WHM, Plesk, DirectAdmin and other panels on your VPS.106 guides
- SecurityKeys, passwords, firewalls and keeping a server patched.115 guides
- Networking & DNSIP addresses, reverse DNS, ports and traffic.34 guides
- Websites & appsWeb servers, WordPress, PHP, Node.js, SSL and app hosting.52 guides
- DatabasesMySQL, MariaDB, PostgreSQL, Redis and MongoDB on a VPS.64 guides
- Billing & accountInvoices, renewals, the client area and your account.9 guides
- TroubleshootingWhen something is not working: checks and fixes.68 guides
- Linux VPSSSH, packages, services and everyday Linux administration.70 guides
- Windows VPS & RDPRemote Desktop, Windows Server settings and Admin RDP tips.58 guides
- Docker & DevOpsContainers, Git deploys, automation, monitoring and backups.58 guides
Still stuck?
Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.
