Log inSign up

Web servers and proxies guides

Nginx, Apache, OpenLiteSpeed, HAProxy, Traefik, redirects, compression and reverse proxies. 16 guides in this topic.

Install and configure Nginx

Install Nginx from the distro packages, add a server block for your domain, switch on HTTPS with Certbot and tune workers and logs.

Install and configure Apache

Install Apache as apache2 or httpd, set up name-based virtual hosts, manage modules and add HTTPS with Certbot.

OpenLiteSpeed web server

Install OpenLiteSpeed from the LiteSpeed repository, secure the WebAdmin panel, add LSPHP, serve your domain on port 80 and 443.

HAProxy load balancer and TLS proxy

Install HAProxy, terminate TLS with a Certbot certificate, route by host name and spread traffic over several backends with health checks.

Load balancing with Nginx upstreams

Spread traffic over several of your own servers with an Nginx upstream group, pick a balancing method and fail over cleanly.

Nginx as a reverse proxy for an app

Put Nginx in front of a Node, Python or Go app on a local port: forwarded headers, WebSockets, timeouts, static files and HTTPS.

Apache as a reverse proxy

Use mod_proxy to forward a domain to an app on a local port, pass WebSockets, keep static files local and balance several instances.

Compression with gzip and Brotli

Turn on gzip and Brotli in Nginx or Apache, pick sensible levels and file types, serve precompressed assets and verify with curl.

HTTPS and www redirects

Send every visitor to one canonical HTTPS address with clean 301 redirects in Nginx or Apache, then lock browsers to HTTPS with HSTS.

Turn off Apache directory listings

Stop Apache from printing a file index for folders without an index page, server wide or per site, and confirm it returns 403.

Nginx Proxy Manager with Docker

Run Nginx Proxy Manager in Docker Compose, publish apps with free certificates from a web form, and keep its admin port away from the internet.

Nginx UI web interface

Install the Nginx UI panel next to a normal Nginx, edit sites and certificates in the browser, and keep its port closed to the public.

Traefik for Docker containers

Route domains to Docker containers with Traefik labels, get certificates automatically from Let's Encrypt and keep the dashboard behind a password.

Apache Tomcat for Java apps

Install Tomcat 10.1 or 11 on OpenJDK, run it as a locked-down systemd service, deploy WAR files and serve them over HTTPS through Nginx.

Encrypted FTP with vsftpd (FTPS)

Set up vsftpd with explicit TLS, jailed users and a fixed passive port range open in the firewall, and see when plain SFTP is the easier choice.

Varnish cache in front of a site

Place Varnish between Nginx TLS termination and your app, write a small VCL that skips logged-in traffic, and confirm hits with headers.