More actions
Nginx Reverse Proxy
In this guide I will be outlining the necessary steps to setup and configure a Nginx Reverse Proxy instance using docker, and configuring SSL using Lets Encrypt and Cloudflare. This will allow the use of subdomains and a safe way to expose services to the internet, which providing SSL based security for these services outside of the local network.
Setup
In this guide we will be using docker, and assuming that a basic installation of docker is installed on the host system. In additon do this for ease of configuration and scalability a docker file was used.
This will also assume that you have a docker macvlan network configured, to allow the container its own IP address for easy of port management with further containers.
First Create the directory to house your docker file and create a file named "docker-compose.yml" with the following content:
services:
app:
container_name: reverse-proxy
image: 'docker.io/jc21/nginx-proxy-manager:latest'
restart: unless-stopped
networks:
service:
ipv4_address: 192.168.1.20
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
healthcheck:
test: ["CMD", "/usr/bin/check-health"]
interval: 10s
timeout: 3s
networks:
service:
external: true
If you are not using macvlan networking some edits can be made to yeild the following:
services:
app:
container_name: reverse-proxy
image: 'docker.io/jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
healthcheck:
test: ["CMD", "/usr/bin/check-health"]
interval: 10s
timeout: 3s
Once this is saved, from that directory run
docker compose up -d
. This will pull and start the container. Now from the IP specified in the macvlan, or from the host address, you should be able to access the web UI with the following:
Now you have spun a fresh install of Nginx proxy manager.
SSL Configuration
In this half of the guide we will be going over the setup, and pulling of a "wildcard" or edge certificate from Cloudflare to validate the SSL of all of the subdomains you will be using from your domain.