swag
The full name of "SWAG" is Secure Web Application Gateway (formerly named linuxserver/letsencrypt). It is a Docker image/container provided by the linuxserver team and used as a reverse proxy + SSL terminal + certificate automatic management + basic protection.
It integrates the following functions: 1. Nginx: acts as a front-end Web server/reverse proxy. 2. Certbot (Let's Encrypt / ZeroSSL plug-in): Automatically apply for and renew SSL Certificates. 3. fail2ban: Used to prevent malicious access, brute force and other attacks. 4. Support some PHP (if you want to run php programs in this proxy) and other modules. Because it integrates reverse proxy + SSL automation, it is a commonly used component when deploying Web services in Docker containerized environments. ###** Two usage methods ** ####** Method A: As a reverse proxy **(Recommended) The most common scenario for SWAG is reverse proxy for other services: ```bash # 1. Enter the reverse proxy configuration directory cd /lzcapp/var/config/nginx # 2. View available templates ls *.sample # 3. Enable a service (such as nextcloud) cp nextcloud.subdomain.conf.sample nextcloud.subdomain.conf # 4. Edit the configuration and point to your service vim nextcloud.subdomain.conf # 5. restart nginx docker exec <swag container> nginx -s reload ``` ####** Method B: Hosting static websites ** If you want to use it to host your website: ```bash #Put website files here cd /lzcapp/var/config/www #Create index.html cat > index.html <<EOF <!DOCTYPE html> <html> <head><title>My Site</title></head> <body> <h1>Welcome to My Site</h1> </body> </html> EOF ``` ### 4ˇ ** Quick test configuration ** ```bash #Check whether nginx is configured correctly docker exec <swag container> nginx -t #Reload configuration docker exec <swag container> nginx -s reload ``` Developer Documentation: docs.linuxserver.io/general/swag/ You can have more ways to play with lazy cat's local area network port forwarding.


