//nbkelley /homelab

Nginx vs Apache for Static Hosting#

What Was Established#

A comparison of Nginx and Apache for the purpose of hosting static HTML/CSS/JS files within a Proxmox LXC or VM.

Key Decisions#

  • Choose Nginx if: You prioritize performance, low memory footprint, and plan to use it as a reverse proxy for modern stacks (Node.js, Python).
  • Choose Apache if: You require .htaccess support for per-directory configuration or are working with legacy PHP/LAMP stacks.

Current Configuration#

Nginx Basic Static Config#

server {
    listen 80;
    root /var/www/html;
    index index.html;
}

Apache Basic Static Config#

<VirtualHost *:80>
    DocumentRoot /var/www/html
    DirectoryIndex index.html
</VirtualHost>

Deployment Commands (LXC)#

To create a standard Ubuntu 22.04 LXC for web hosting:

# Create LXC container
pct create 100 local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst \
--rootfs 8G --ostype ubuntu --hostname web-static \
--net0 name=eth0,bridge=vmbr0,ip=dhcp --storage local-lvm

# Install Nginx
apt update && apt install nginx

# Install Apache
apt update && apt install apache2

Historical Notes#

This comparison was documented in March 2025. Nginx was noted as the preferred choice for modern, lightweight Proxmox deployments.

Open Questions#

  • Implementation of automated SSL via Let’s Encrypt using Nginx Proxy Manager.

Web Server Stack (Nginx + Apache)

Sources#

  • ingested/chats/022-Apache vs Nginx: Key Differences Explained.md Setting Up Web Server on Proxmox Guide · ingested/chats/Setting_Up_Web_Server_on_Proxmox_Guide