SWAG - Secure Web Application Gateway (formerly known as letsencrypt, no relation to Let's Encrypt™) sets up an Nginx webserver and reverse proxy with php support and a built-in certbot client that automates free SSL server certificate generation and renewal processes (Let's Encrypt and ZeroSSL). It also contains fail2ban for intrusion prevention.
Before running this container, make sure that the url and subdomains are properly forwarded to this container's host, and that port 443 (and/or 80) is not being used by another service on the host (NAS gui, another webserver, etc.).
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 with http validation, or wildcard with dns validation. You can use our duckdns image to update your IP on duckdns.org.
For http validation, port 80 on the internet side of the router should be forwarded to this container's port 80
For dns validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under /config/dns-conf
Cloudflare provides free accounts for managing dns and is very easy to use with this image. Make sure that it is set up for "dns only" instead of "dns + proxy"
Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS"
DuckDNS only supports two types of DNS validated certificates (not both at the same time):
Certs that only cover your main subdomain (ie. yoursubdomain.duckdns.org, leave the SUBDOMAINS variable empty)
Certs that cover sub-subdomains of your main subdomain (ie. *.yoursubdomain.duckdns.org, set the SUBDOMAINS variable to wildcard)
--cap-add=NET_ADMIN is required for fail2ban to modify iptables
After setup, navigate to https://yourdomain.url to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at /config/nginx/site-confs/default.conf).
Certs are checked nightly and if expiration is within 30 days, renewal is attempted. If your cert is about to expire in less than 30 days, check the logs under /config/log/letsencrypt to see why the renewals have been failing. It is recommended to input your e-mail in docker parameters so you receive expiration notices from Let's Encrypt in those circumstances.
The container detects changes to url and subdomains, revokes existing certs and generates new ones during start.
Per RFC7919, the container is shipping ffdhe4096 as the dhparams.pem.
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 <username>
You can add multiple user:pass to .htpasswd. For the first user, use the above command, for others, use the above command without the -c flag, as it will force deletion of the existing .htpasswd and creation of a new one
You can also use ldap auth for security and access control. A sample, user configurable ldap.conf is provided, and it requires the separate image linuxserver/ldap-auth to communicate with an ldap server.
The default site config resides at /config/nginx/site-confs/default.conf. Feel free to modify this file, and you can add other conf files to this directory. However, if you delete the default file, a new default will be created on container start.
Preset reverse proxy config files are added for popular apps. See the README.md file under /config/nginx/proxy_confs for instructions on how to enable them. The preset confs reside in and get imported from this repo.
If you wish to hide your site from search engine crawlers, you may find it useful to add this configuration line to your site config, within the server block, above the line where ssl.conf is included add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; This will ask Google et al not to index and list your site. Be careful with this, as you will eventually be de-listed if you leave this line in on a site you wish to be present on search engines
If you wish to redirect http to https, you must expose port 80
This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc.
To use these certs in other containers, do either of the following:
(Easier) Mount the container's config folder in other containers (ie. -v /path-to-swag-config:/swag-ssl) and in the other containers, use the cert location /swag-ssl/keys/letsencrypt/
(More secure) Mount the SWAG folder etc that resides under /config in other containers (ie. -v /path-to-swag-config/etc:/swag-ssl) and in the other containers, use the cert location /swag-ssl/letsencrypt/live/<your.domain.url>/ (This is more secure because the first method shares the entire SWAG config folder with other containers, including the www files, whereas the second method only shares the ssl certs)
These certs include:
cert.pem, chain.pem, fullchain.pem and privkey.pem, which are generated by Certbot and used by nginx and various other apps
privkey.pfx, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password)
priv-fullchain-bundle.pem, a pem cert that bundles the private key and the fullchain, used by apps like ZNC
This container includes fail2ban set up with 5 jails by default:
nginx-http-auth
nginx-badbots
nginx-botsearch
nginx-deny
nginx-unauthorized
To enable or disable other jails, modify the file /config/fail2ban/jail.local
To modify filters and actions, instead of editing the .conf files, create .local files with the same name and edit those because .conf files get overwritten when the actions and filters are updated. .local files will append whatever's in the .conf files (ie. nginx-http-auth.conf --> nginx-http-auth.local)
You can check which jails are active via docker exec -it swag fail2ban-client status
You can check the status of a specific jail via docker exec -it swag fail2ban-client status <jail name>
You can unban an IP via docker exec -it swag fail2ban-client set <jail name> unbanip <IP>
SWAG - Secure Web Application Gateway (formerly known as letsencrypt, no relation to Let's Encrypt™) sets up an Nginx webserver and reverse proxy with php support and a built-in certbot client that automates free SSL server certificate generation and renewal processes (Let's Encrypt and ZeroSSL). It also contains fail2ban for intrusion prevention.
Before running this container, make sure that the url and subdomains are properly forwarded to this container's host, and that port 443 (and/or 80) is not being used by another service on the host (NAS gui, another webserver, etc.).
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 with http validation, or wildcard with dns validation. You can use our duckdns image to update your IP on duckdns.org.
For http validation, port 80 on the internet side of the router should be forwarded to this container's port 80
For dns validation, make sure to enter your credentials into the corresponding ini (or json for some plugins) file under /config/dns-conf
Cloudflare provides free accounts for managing dns and is very easy to use with this image. Make sure that it is set up for "dns only" instead of "dns + proxy"
Google dns plugin is meant to be used with "Google Cloud DNS", a paid enterprise product, and not for "Google Domains DNS"
DuckDNS only supports two types of DNS validated certificates (not both at the same time):
Certs that only cover your main subdomain (ie. yoursubdomain.duckdns.org, leave the SUBDOMAINS variable empty)
Certs that cover sub-subdomains of your main subdomain (ie. *.yoursubdomain.duckdns.org, set the SUBDOMAINS variable to wildcard)
--cap-add=NET_ADMIN is required for fail2ban to modify iptables
After setup, navigate to https://yourdomain.url to access the default homepage (http access through port 80 is disabled by default, you can enable it by editing the default site config at /config/nginx/site-confs/default.conf).
Certs are checked nightly and if expiration is within 30 days, renewal is attempted. If your cert is about to expire in less than 30 days, check the logs under /config/log/letsencrypt to see why the renewals have been failing. It is recommended to input your e-mail in docker parameters so you receive expiration notices from Let's Encrypt in those circumstances.
The container detects changes to url and subdomains, revokes existing certs and generates new ones during start.
Per RFC7919, the container is shipping ffdhe4096 as the dhparams.pem.
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 <username>
You can add multiple user:pass to .htpasswd. For the first user, use the above command, for others, use the above command without the -c flag, as it will force deletion of the existing .htpasswd and creation of a new one
You can also use ldap auth for security and access control. A sample, user configurable ldap.conf is provided, and it requires the separate image linuxserver/ldap-auth to communicate with an ldap server.
The default site config resides at /config/nginx/site-confs/default.conf. Feel free to modify this file, and you can add other conf files to this directory. However, if you delete the default file, a new default will be created on container start.
Preset reverse proxy config files are added for popular apps. See the README.md file under /config/nginx/proxy_confs for instructions on how to enable them. The preset confs reside in and get imported from this repo.
If you wish to hide your site from search engine crawlers, you may find it useful to add this configuration line to your site config, within the server block, above the line where ssl.conf is included add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive"; This will ask Google et al not to index and list your site. Be careful with this, as you will eventually be de-listed if you leave this line in on a site you wish to be present on search engines
If you wish to redirect http to https, you must expose port 80
This container includes auto-generated pfx and private-fullchain-bundle pem certs that are needed by other apps like Emby and Znc.
To use these certs in other containers, do either of the following:
(Easier) Mount the container's config folder in other containers (ie. -v /path-to-swag-config:/swag-ssl) and in the other containers, use the cert location /swag-ssl/keys/letsencrypt/
(More secure) Mount the SWAG folder etc that resides under /config in other containers (ie. -v /path-to-swag-config/etc:/swag-ssl) and in the other containers, use the cert location /swag-ssl/letsencrypt/live/<your.domain.url>/ (This is more secure because the first method shares the entire SWAG config folder with other containers, including the www files, whereas the second method only shares the ssl certs)
These certs include:
cert.pem, chain.pem, fullchain.pem and privkey.pem, which are generated by Certbot and used by nginx and various other apps
privkey.pfx, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password)
priv-fullchain-bundle.pem, a pem cert that bundles the private key and the fullchain, used by apps like ZNC
This container includes fail2ban set up with 5 jails by default:
nginx-http-auth
nginx-badbots
nginx-botsearch
nginx-deny
nginx-unauthorized
To enable or disable other jails, modify the file /config/fail2ban/jail.local
To modify filters and actions, instead of editing the .conf files, create .local files with the same name and edit those because .conf files get overwritten when the actions and filters are updated. .local files will append whatever's in the .conf files (ie. nginx-http-auth.conf --> nginx-http-auth.local)
You can check which jails are active via docker exec -it swag fail2ban-client status
You can check the status of a specific jail via docker exec -it swag fail2ban-client status <jail name>
You can unban an IP via docker exec -it swag fail2ban-client set <jail name> unbanip <IP>
01.10.23: - Fix "unrecognized arguments" issue in DirectAdmin DNS plugin.
28.08.23: - Add Namecheap DNS plugin.
12.08.23: - Add FreeDNS plugin. Detect certbot DNS authenticators using CLI.
07.08.23: - Add Bunny DNS Configuration.
27.07.23: - Added support for dreamhost validation.
25.05.23: - Rebase to Alpine 3.18, deprecate armhf.
27.04.23: - Existing users should update: authelia-location.conf, authelia-server.conf, authentik-location.conf, authentik-server.conf - Simplify auth configs and fix Set-Cookie header bug.
13.04.23: - Existing users should update: nginx.conf, authelia-location.conf, authentik-location.conf, and site-confs/default.conf - Move ssl.conf include to default.conf. Remove Authorization headers in authelia. Sort proxy_set_header in authelia and authentik.
09.03.23: - Add Google Domains DNS support, google-domains.
02.03.23: - Set permissions on crontabs during init.
09.02.23: - Existing users should update: proxy.conf, authelia-location.conf and authelia-server.conf - Add Authentik configs, update Authelia configs.
06.02.23: - Add porkbun support back in.
21.01.23: - Unpin certbot version (allow certbot 2.x). !!BREAKING CHANGE!! We are temporarily removing the certbot porkbun plugin until a new version is released that is compatible with certbot 2.x.
20.01.23: - Rebase to alpine 3.17 with php8.1.
16.01.23: - Remove nchan module because it keeps causing crashes.
08.12.22: - Revamp certbot init.
03.12.22: - Remove defunct cloudxns plugin.
22.11.22: - Pin acme to the same version as certbot.
22.11.22: - Pin certbot to 1.32.0 until plugin compatibility improves.
05.11.22: - Update acmedns plugin handling.
06.10.22: - Switch to certbot-dns-duckdns. Update cpanel and gandi dns plugin handling. Minor adjustments to init logic.
05.10.22: - Use certbot file hooks instead of command line hooks
04.10.22: - Add godaddy and porkbun dns plugins.
03.10.22: - Add default_server back to default site conf's https listen.
22.09.22: - Added support for DO DNS validation.
22.09.22: - Added certbot-dns-acmedns for DNS01 validation.
20.05.21: - Modify resolver.conf generation to detect and ignore ipv6.
14.05.21: - Existing users should update: nginx.conf, ssl.conf, proxy.conf, and the default site-conf - Rework nginx.conf to be inline with alpine upstream and relocate lines from other files. Use linuxserver.io wheel index for pip packages. Switch to using ffdhe4096 for dhparams.pem per RFC7919. Added worker_processes.conf, which sets the number of nginx workers, and resolver.conf, which sets the dns resolver. Both conf files are auto-generated only on first start and can be user modified later.
21.04.21: - Existing users should update: authelia-server.conf and authelia-location.conf - Add remote name/email headers and pass http method.
12.04.21: - Add php7-gmp and php7-pecl-mailparse.
12.04.21: - Add support for vultr dns validation.
14.03.21: - Add support for directadmin dns validation.
12.02.21: - Clean up rust/cargo cache, which ballooned the image size in the last couple of builds.
10.02.21: - Fix aliyun, domeneshop, inwx and transip dns confs for existing users.
09.02.21: - Rebasing to alpine 3.13. Add nginx mods brotli and dav-ext. Remove nginx mods lua and lua-upstream (due to regression over the last couple of years).
26.01.21: - Add support for hetzner dns validation.
20.01.21: - Add check for ZeroSSL EAB retrieval.
08.01.21: - Add support for getting certs from ZeroSSL via optional CERTPROVIDER env var. Update aliyun, domeneshop, inwx and transip dns plugins with the new plugin names. Hide donoteditthisfile.conf because users were editing it despite its name. Suppress harmless error when no proxy confs are enabled.
03.01.21: - Existing users should update: /config/nginx/site-confs/default.conf - Add helper pages to aid troubleshooting
10.12.20: - Add support for njalla dns validation
09.12.20: - Check for template/conf updates and notify in the log. Add support for gehirn and sakuracloud dns validation.
01.10.23: - Fix "unrecognized arguments" issue in DirectAdmin DNS plugin.
28.08.23: - Add Namecheap DNS plugin.
12.08.23: - Add FreeDNS plugin. Detect certbot DNS authenticators using CLI.
07.08.23: - Add Bunny DNS Configuration.
27.07.23: - Added support for dreamhost validation.
25.05.23: - Rebase to Alpine 3.18, deprecate armhf.
27.04.23: - Existing users should update: authelia-location.conf, authelia-server.conf, authentik-location.conf, authentik-server.conf - Simplify auth configs and fix Set-Cookie header bug.
13.04.23: - Existing users should update: nginx.conf, authelia-location.conf, authentik-location.conf, and site-confs/default.conf - Move ssl.conf include to default.conf. Remove Authorization headers in authelia. Sort proxy_set_header in authelia and authentik.
09.03.23: - Add Google Domains DNS support, google-domains.
02.03.23: - Set permissions on crontabs during init.
09.02.23: - Existing users should update: proxy.conf, authelia-location.conf and authelia-server.conf - Add Authentik configs, update Authelia configs.
06.02.23: - Add porkbun support back in.
21.01.23: - Unpin certbot version (allow certbot 2.x). !!BREAKING CHANGE!! We are temporarily removing the certbot porkbun plugin until a new version is released that is compatible with certbot 2.x.
20.01.23: - Rebase to alpine 3.17 with php8.1.
16.01.23: - Remove nchan module because it keeps causing crashes.
08.12.22: - Revamp certbot init.
03.12.22: - Remove defunct cloudxns plugin.
22.11.22: - Pin acme to the same version as certbot.
22.11.22: - Pin certbot to 1.32.0 until plugin compatibility improves.
05.11.22: - Update acmedns plugin handling.
06.10.22: - Switch to certbot-dns-duckdns. Update cpanel and gandi dns plugin handling. Minor adjustments to init logic.
05.10.22: - Use certbot file hooks instead of command line hooks
04.10.22: - Add godaddy and porkbun dns plugins.
03.10.22: - Add default_server back to default site conf's https listen.
22.09.22: - Added support for DO DNS validation.
22.09.22: - Added certbot-dns-acmedns for DNS01 validation.
20.05.21: - Modify resolver.conf generation to detect and ignore ipv6.
14.05.21: - Existing users should update: nginx.conf, ssl.conf, proxy.conf, and the default site-conf - Rework nginx.conf to be inline with alpine upstream and relocate lines from other files. Use linuxserver.io wheel index for pip packages. Switch to using ffdhe4096 for dhparams.pem per RFC7919. Added worker_processes.conf, which sets the number of nginx workers, and resolver.conf, which sets the dns resolver. Both conf files are auto-generated only on first start and can be user modified later.
21.04.21: - Existing users should update: authelia-server.conf and authelia-location.conf - Add remote name/email headers and pass http method.
12.04.21: - Add php7-gmp and php7-pecl-mailparse.
12.04.21: - Add support for vultr dns validation.
14.03.21: - Add support for directadmin dns validation.
12.02.21: - Clean up rust/cargo cache, which ballooned the image size in the last couple of builds.
10.02.21: - Fix aliyun, domeneshop, inwx and transip dns confs for existing users.
09.02.21: - Rebasing to alpine 3.13. Add nginx mods brotli and dav-ext. Remove nginx mods lua and lua-upstream (due to regression over the last couple of years).
26.01.21: - Add support for hetzner dns validation.
20.01.21: - Add check for ZeroSSL EAB retrieval.
08.01.21: - Add support for getting certs from ZeroSSL via optional CERTPROVIDER env var. Update aliyun, domeneshop, inwx and transip dns plugins with the new plugin names. Hide donoteditthisfile.conf because users were editing it despite its name. Suppress harmless error when no proxy confs are enabled.
03.01.21: - Existing users should update: /config/nginx/site-confs/default.conf - Add helper pages to aid troubleshooting
10.12.20: - Add support for njalla dns validation
09.12.20: - Check for template/conf updates and notify in the log. Add support for gehirn and sakuracloud dns validation.
20.09.20: - Existing users should update: nginx.conf - Added geoip2 configs. Added MAXMINDDB_LICENSE_KEY variable to readme.
08.09.20: - Add php7-xsl.
01.09.20: - Existing users should update: nginx.conf, proxy.conf, and various proxy samples - Global websockets across all configs.
03.08.20: - Initial release.
Last update: November 18, 2023 Created: August 3, 2020
\ No newline at end of file
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index ef68720962..6d4544c70f 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ