====== SWAG ====== Secure Web Application Gateway is a rebirth of the letsencrypt docker image, a full fledged web server and reverse proxy that includes Nginx, Php7, Certbot (Let's Encrypt client) and Fail2ban. Before running this container, make sure that the url and subdomains are properly forwarded to this container's host. - Port 443 on the internet side of the router should be forwarded to this container's port 443. - If you need a dynamic dns provider, you can use the free provider duckdns.org where the url will be yoursubdomain.duckdns.org and the subdomains can be "www,ftp,cloud," or "wildcard" if using duckdns validation - The container detects changes to url and subdomains, revokes existing certs and generates new ones during start. - If you'd like to password protect your sites, you can use htpasswd. Run the following command on your host to generate the htpasswd file docker exec -it swag htpasswd -c /config/nginx/.htpasswd ===== Version ===== I used linuxserver's version ===== Docker Setup ===== * publish a new network port * 180 -> 80 TCP * 1443 -> 443 TCP * volumes: * /appdata -> /mnt/nvme/appdata/swag * /config -> /mnt/nvme/appdata/swag * network: * Type: bridge * Fixed IP address (optional): blank * Env: * EMAIL: I used my regular gmail account * URL: brimble.com * SUBDOMAINS: add all of your subdomains. I had 12. These need to be setup on your domain setup too. (NOIP for me at the time) * ONLY_SUBDOMAINS: false * VALIDATION: http * STAGING: false * PUID: 99 * PGID: 100 ===== Random Fixes ===== ==== stream ==== * After last update, websites would not load and had following error in swag logs:nginx: [emerg] "stream" directive is not allowed here in /etc/nginx/conf.d/stream.conf:3 * Found fix in forums: * connect to terminal inside docker using vxcode or docker exec * execute following ls -al /etc/nginx/conf.d/ /etc/nginx/stream.d/ mv -v /etc/nginx/conf.d/stream.conf /etc/nginx/stream.d/ * restart swag * Found longer term fix... just update some outdated config files with the newer samples and all was well again. No longer need the above steps. ==== dashboard ==== * Add variable to swag * Name: Dashboard * Key: DOCKER_MODS * Value: linuxserver/mods:swag-dashboard * add CNAME for dashboard and add dashboard to swag subdomains * conf file was auto added * restart swag