Skip to content

nginx

Nginx web server reverse proxy example.

nginx

Prepare

podman pull docker.io/nginx:latest
mkdir -p $HOME/apps/{variables,container_data}
mkdir -p $HOME/apps/container_data/nginx/logs

Installation

touch $HOME/.config/containers/systemd/nginx.container
# nginx.container
[Unit]
Description=Nginx server
[Container]
ContainerName=nginx
HostName=<hostname_of_server>
AutoUpdate=registry
Image=docker.io/nginx:latest
Network=skynet.network
PublishPort=80:80
Environment=TZ=Europe/Athens
Volume=%h/apps/container_data/nginx:/etc/nginx/conf.d:ro
Volume=%h/apps/container_data/nginx/logs:/var/log/nginx
[Service]
Restart=always
TimeoutStartSec=300
[Install]
WantedBy=default.target

Restart Nginx

systemctl --user restart nginx

Usage

Open http://.skynet.lan

Troubleshooting

podman logs -f nginx
journalctl --user -u nginx -n 200