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.

    IntermediateLinux VPS and cPanel hosting2 min read
  • 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.

    IntermediateLinux server5 min read
  • 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.

    AdvancedLinux server7 min read
  • 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.

    BeginnerLinux server5 min read
  • 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.

    AdvancedLinux server5 min read
  • 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.

    AdvancedDirectAdmin admin2 min read
  • 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.

    IntermediateLinux VPS2 min read
  • 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.

    IntermediateLinux server3 min read
  • 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.

    IntermediateLinux server2 min read
  • 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.

    IntermediateLinux server6 min read
  • 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.

    IntermediateLinux server5 min read
  • 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.

    BeginnerLinux server4 min read
  • 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.

    AdvancedLinux server4 min read
  • 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.

    BeginnerLinux server5 min read
  • 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.

    IntermediateLinux server5 min read
  • 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.

    IntermediateLinux server5 min read
  • 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.

    IntermediateLinux server7 min read
  • 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.

    BeginnerLinux server4 min read
  • 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.

    BeginnerLinux server5 min read
  • 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.

    BeginnerLinux server5 min read

Browse by topic

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.