English
Create and configure public external traffic stack
We will configure the public traffic Docker stack; we will configure the firewall to allow the necessary ports; we will bring the stack up through Arcane; we will do Port Forwarding of the HTTP and HTTPS ports for Nginx; we will configure Nginx to redirect traffic to the containers; and we will allow Nginx to act as a proxy for Home Assistant. The stack consists of the following containers:
- Nginx Proxy Manager: Reverse Proxy engine and manager.
Steps
Run:
./scripts/create_nginx_folder.shto generate the container directory on the SSD.Edit the stack file:
nano ./files/public-traffic-stack.yml.Replace
TZ=America/New_Yorkwith your system time zone. You can use this list as a reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.Replace
-subnet: fda6:80d8:cf96:1::/64with the CIDR you generated during docker install using the subnet1.Copy all contents of the file to the clipboard. Save and exit with
Ctrl + X, Y, Enter.Run:
./scripts/public_traffic_firewalld_services.sh. Configure Firewalld for containers. The script opens the ports for HTTP and HTTPS for Nginx.Add stack in Arcane from the browser.
- Access Arcane through https://server.lan:3552.
- Click "Projects" on the left menu and create a new project.
- Name it "public-traffic" and paste the content of the public-traffic-stack.yml that you copied to the clipboard and create the stack. From now on, modifications to the stack must be made through Arcane and not in the file.
Configure the router. If you don't want to expose your services to the internet, skip this step. Each router is different, so you will have to consult your manual to be able to do the following steps.
- Forward port 80 and 443 in TCP protocol to the server so that Nginx can reverse proxy the internal services.
Configure proxy hosts in Nginx using DDNS.
- Access Nginx through http://server.lan:8181.
- Use
admin@example.comandchangemeas username and password and change the details and password to a secure one. It is again recommended to use Bitwarden for the same. - Navigate to the
SSL Certificatestab. - Press
Add SSL Certificate. SelectLet's Encryptas certificate provider.- Set up a wildcard domain SSL certificate with Let's Encrypt. For example
*.myhome.duckdns.org(note the*at the beginning of the domain). - You need to enable
Use DNS Challenge. - Select DuckDNS as the DNS provider.
- Replace
your-duckdns-tokenwith the token you generated on DuckDNS.org - Accept the terms of service and save.
- Set up a wildcard domain SSL certificate with Let's Encrypt. For example
- Navigate to the "Access List" tab and configure a private access list.
- Press
Add Access List. - In the
Detailstab fill out:- "Name": Private.
- "Pass Auth to Host": enabled.
- In the
Accesstab fill out:- allow: 192.168.1.0/24. Use your LAN IP range if different.
- allow: XXXX:XXXX:XXXX:1::/64. Where "XXXX:XXXX:XXXX" is your IPv6 ULA prefix and ":1" is the "lan" subnet. Skip if not using IPv6.
- allow: 10.13.13.0/24. This is for the WireGuard VPN access.
- Click
Save.
- Press
- Navigate to the “Proxy Hosts” tab and configure all the proxy hosts we will need. For now, only the Cockpit, Arcane and Nginx services exist. The rest will be created later.
- For each row in the table below, click
Add Proxy Hostand fill the data. If you don't want to share a service to the internet, you can use thePrivate"Access List" instead ofPublic. In theSSLtab always choose*.myhome.duckdns.orgasSSL certificateand enable all options.
- For each row in the table below, click
Service Domain Scheme Hostname Port Block Exploits Websockets Access List Advanced Bazarr bazarr.myhome.duckdns.org http bazarr 6767 enabled enabled Private N/A Beszel beszel.myhome.duckdns.org http beszel 8090 enabled enabled Private N/A Cockpit cockpit.myhome.duckdns.org https 172.21.0.1 9090 enabled enabled Private N/A ComfyUI comfyui.myhome.duckdns.org http comfyui 8188 enabled enabled Private N/A Arcane arcane.myhome.duckdns.org http arcane 3552 enabled enabled Private N/A Flaresolverr flaresolverr.myhome.duckdns.org http flaresolverr 8191 enabled enabled Private N/A Gotify gotify.myhome.duckdns.org http gotify 80 enabled enabled Public N/A Home Assistant homeassistant.myhome.duckdns.org http homeassistant 8123 enabled enabled Public N/A Jellyfin jellyfin.myhome.duckdns.org http jellyfin 8096 enabled enabled Public # Disable buffering when the nginx proxy gets very resource heavy upon streaming
proxy_buffering off;
# Proxy main Jellyfin traffic
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_headers_hash_max_size 2048;
proxy_headers_hash_bucket_size 128;
# Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "0";
add_header X-Content-Type-Options "nosniff";Nextcloud nextcloud.myhome.duckdns.org http nextcloud 80 enabled enabled Public client_body_buffer_size 512k;
proxy_read_timeout 86400s;
client_max_body_size 0;NPM nginx.myhome.duckdns.org http 127.0.0.1 81 enabled enabled Private N/A Ollama ollamaa.myhome.duckdns.org http ollama 11434 enabled enabled Private N/A Open WebUI openwebui.myhome.duckdns.org http openwebui 8080 enabled enabled Private N/A Profilarr profilarr.myhome.duckdns.org http profilarr 6868 enabled enabled Private N/A Prowlarr prowlarr.myhome.duckdns.org http prowlarr 9696 enabled enabled Private N/A qBittorrent qbittorrent.myhome.duckdns.org http qbittorrent 8080 enabled enabled Private N/A Radarr radarr.myhome.duckdns.org http radarr 7878 enabled enabled Private N/A Seerr seerr.myhome.duckdns.org http seerr 5055 enabled enabled Public N/A Sonarr sonarr.myhome.duckdns.org http sonarr 8989 enabled enabled Private N/A Z-Wave JS zwavejs.myhome.duckdns.org http zwavejs 8091 enabled enabled Private N/A You can test that Nginx works by accessing itself through the URL with its subdomain: https://nginx.myhome.duckdns.org. Try it from inside your local network to test split horizon DNS and from outside to test DDNS. From outside, you should get a
403 Forbiddenerror.Back in Arcane, edit the
public-trafficstack we just created.- Under
ports, delete or comment out the8181:81mapping. We can now access it through the domain. - Click
Update the stack.
- Under
Modify the Arcane stack:
nano /Apps/arcane-stack.yml.- Delete or comment out the entire
portssection. We can now access it through the domain. - Save and exit with
Ctrl + X, Y, Enter. - Update the stack after the changes:
docker compose -f /Apps/arcane-stack.yml up -d.
- Delete or comment out the entire