专属
文档
插件
助手
邀请
顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像
专业版
轩辕镜像 官方专业版
轩辕镜像
专业版
首页个人中心搜索镜像

交易
充值流量我的订单

文档

工具

功能
提交工单页面收录

帮助
轩辕镜像免费版

其他
关于我们网站地图
热门搜索:
swag

linuxserver/swag

LinuxServer.io 社区镜像

SWAG(Secure Web Application Gateway)是一个安全Web应用网关,集成Nginx反向代理、PHP支持、Certbot客户端(自动管理Let's Encrypt和ZeroSSL证书)以及fail2ban入侵防护,简化Web服务安全部署。

417 次收藏下载次数: 0状态:社区镜像维护者:LinuxServer.io 社区镜像仓库类型:镜像最近更新:26 天前
让 AI 帮你使用轩辕镜像? · 展开查看说明

如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。

只需在 AI 对话中先发送下面这句话即可:

请先完整阅读并严格遵守以下文档中的全部规则与要求:

https://xuanyuan.cloud/agents.md

在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。

查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。

DockerHub 官方简介
轩辕镜像中文简介
标签列表
镜像标签列表与下载命令
轩辕镜像,不浪费每一次拉取。
点击查看

https://github.com/linuxserver/docker-swag

This readme has been truncated from the full version found https://github.com/linuxserver/docker-swag

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.

Application Setup

Validation and initial setup

  • 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 https://hub.docker.com/r/linuxserver/duckdns/ 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):
      1. Certs that only cover your main subdomain (ie. yoursubdomain.duckdns.org, leave the SUBDOMAINS variable empty)
      2. 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://example.com 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.

Certbot Plugins

SWAG includes many Certbot plugins out of the box, but not all plugins can be included. If you need a plugin that is not included, the quickest way to have the plugin available is to use our https://github.com/linuxserver/docker-mods/tree/universal-package-install.

Set the following environment variables on your container:

yaml
DOCKER_MODS=linuxserver/mods:universal-package-install
INSTALL_PIP_PACKAGES=certbot-dns-<plugin>

Set the required credentials (usually found in the plugin documentation) in /config/dns-conf/<plugin>.ini. It is recommended to attempt obtaining a certificate with STAGING=true first to make sure the plugin is working as expected.

Security and password protection

  • 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 https://hub.docker.com/r/linuxserver/ldap-auth/ to communicate with an ldap server.

Site config and reverse proxy

  • 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 https://github.com/linuxserver/reverse-proxy-confs.
  • 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

Using certs in other containers

  • This container includes auto-generated pfx and private-full***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:
    1. (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/
    2. (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:
    1. cert.pem, chain.pem, fullchain.pem and privkey.pem, which are generated by Certbot and used by nginx and various other apps
    2. privkey.pfx, a format supported by Microsoft and commonly used by dotnet apps such as Emby Server (no password)
    3. priv-fullchain-bundle.pem, a pem cert that bundles the private key and the fullchain, used by apps like ZNC

Using fail2ban

  • This container includes fail2ban set up with 5 jails by default:
    1. nginx-http-auth
    2. nginx-badbots
    3. nginx-botsearch
    4. nginx-deny
    5. 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>
  • A list of commands for fail2ban-client can be found here

Updating configs

  • This container creates a number of configs for nginx, proxy samples, etc.
  • Config updates are noted in the changelog but not automatically applied to your files.
  • If you have modified a file with noted changes in the changelog:
    1. Keep your existing configs as is (not broken, don't fix)
    2. Review our repository commits and apply the new changes yourself
    3. Delete the modified config file with listed updates, restart the container, reapply your changes
  • If you have NOT modified a file with noted changes in the changelog:
    1. Delete the config file with listed updates, restart the container
  • Proxy sample updates are not listed in the changelog. See the changes here: https://github.com/linuxserver/reverse-proxy-confs/commits/master
  • Proxy sample files WILL be updated, however your renamed (enabled) proxy files will not.
  • You can check the new sample and adjust your active config as needed.

QUIC support

This image supports QUIC (also known as HTTP/3) but it must be explicitly enabled in each proxy conf, and the default conf, because if the listener is enabled and you don't expose 443/UDP, it can break connections with some browsers.

To enable QUIC, expose 443/UDP to your clients, then uncomment both QUIC listeners in all of your active proxy confs, as well as the default conf, and restart the container.

You should also uncomment the Alt-Svc header in your ssl.conf so that browsers are aware that you offer QUIC connectivity.

It is recommended to increase the UDP send/recieve buffer on the host by setting the net.core.rmem_max and net.core.wmem_max sysctls. Suggested values are 4-16Mb (4194304-*** bytes). For persistence between reboots use /etc/sysctl.d/.

Migration from the old linuxserver/letsencrypt image

Please follow the instructions on this blog post.

Usage

bash
docker run -d \
  --name=swag \
  --cap-add=NET_ADMIN \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Etc/UTC \
  -e URL=example.com \
  -e VALIDATION=http \
  -e SUBDOMAINS=www, `#optional` \
  -e CERTPROVIDER= `#optional` \
  -e DNSPLUGIN=cloudflare `#optional` \
  -e PROPAGATION= `#optional` \
  -e EMAIL= `#optional` \
  -e ONLY_SUBDOMAINS=false `#optional` \
  -e EXTRA_DOMAINS= `#optional` \
  -e STAGING=false `#optional` \
  -e DISABLE_F2B= `#optional` \
  -e SWAG_AUTORELOAD= `#optional` \
  -e SWAG_AUTORELOAD_WATCHLIST= `#optional` \
  -p 443:443 \
  -p 80:80 `#optional` \
  -p 443:443/udp `#optional` \
  -v /path/to/swag/config:/config \
  --restart unless-stopped \
  lscr.io/linuxserver/swag:latest

镜像拉取方式

您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。

轩辕镜像加速拉取命令点我查看更多 swag 镜像标签

docker pull docker.xuanyuan.run/linuxserver/swag:<标签>

使用方法:

  • 登录认证方式
  • 免认证方式

DockerHub 原生拉取命令

docker pull linuxserver/swag:<标签>

轩辕镜像配置手册

按平台快速找到配置文档

Docker

登录仓库拉取

登录认证 · 私有仓库

专属域名拉取

免登录 · 高速拉取

Linux

Docker 镜像配置

Windows / Mac

Docker Desktop 配置

MacOS OrbStack

OrbStack 容器

Docker Compose

Compose 项目配置

NAS

群晖

Synology 配置

飞牛

fnOS 镜像配置

绿联

绿联 NAS

威联通

QNAP 配置

极空间

极空间 NAS

企业仓库

其他仓库

ghcr · Quay · nvcr

Harbor 镜像源

Proxy Repository 对接

Portainer 镜像源

Registries 配置

Nexus 镜像源

Docker Proxy 缓存

开发工具

Dev Containers

VS Code 开发容器

Podman

Podman 配置指南

Singularity / Apptainer

HPC 科学计算容器

Kubernetes

K8s Containerd

Kubernetes · Containerd

K3s

轻量级集群

面板 / 网络

爱快路由

iKuai 镜像加速

宝塔面板

一键配置镜像源

AI

用 AI 使用轩辕镜像

agents.md · AI 对话 · 提示词

一键安装

一键安装 Docker

Linux Docker 一键安装

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

功能

免费版与专业版区别

功能对比 · 版本选择

支持的镜像仓库

Docker Hub · GCR · GHCR

新手拉取配置

登录 · 专属域名 · 配置

docker search 限制

专属域名 · Hub 搜索

不支持 push

仅支持 pull · 不支持

拉取速度原因

带宽 · 缓存 · 冷热镜像

错误码

402 与流量用尽

402 · 流量包 · 充值

401 认证失败

401 · docker login

manifest unknown

标签错误 · 镜像不存在

410 Gone 排查

410 · Docker 升级

429 限流

免费版 · 请求频率

其他报错

DNS 超时

DNS 解析 · 网络超时

TLS 证书失败

no matching manifest(架构)

账号

失败是否计费

manifest · blob · 计费

申请开发票(企业 / 个人)

企业 · 个人 · 工单

修改登录密码

网站 · 仓库 · 重置

注销账户

工单 · 数据 · 注销

原理

mirrors 不生效

daemon.json · 重启

去掉域名前缀

docker tag · 重命名

指定架构拉取

ARM64 · AMD64 · 多架构

latest 与「最新」

digest · 版本号 · 标签

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
LinuxServer.io 社区镜像
...
linuxserver/swag
教程轩辕镜像功能与使用教程
定价查看流量套餐与价格
热门查看热门 Docker 镜像推荐
博客Docker 镜像公告与技术博客
官方公众号:源码跳动|官方技术交流群:831623681
官方公众号:源码跳动|官方技术交流群:|问题咨询请:提交工单
商务合作:点击复制邮箱
©2024-2026 源码跳动
商务合作:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.

更多 swag 镜像推荐

linuxserver/sonarr logo

linuxserver/sonarr

LinuxServer.io 社区镜像
由LinuxServer.io提供的Sonarr容器,是一款专为电视节目集管理设计的自动化工具,能够监控指定剧集的更新信息、自动从索引器获取下载链接并通过下载客户端(如Deluge、qBittorrent等)完成资源下载,同时支持按自定义规则整理文件结构、重命名剧集文件以保持媒体库整洁有序;LinuxServer.io作为专注于提供高质量容器化应用的团队,其构建的Sonarr容器基于轻量级Linux系统,优化了资源占用与运行稳定性,适合家庭媒体服务器或个人影视库的自动化管理场景使用。
2.1千 次收藏10亿+ 次下载
5 天前更新
linuxserver/jackett logo

linuxserver/jackett

LinuxServer.io 社区镜像
这是由LinuxServer.io提供的Jackett容器,其中Jackett是一款实用的种子索引聚合工具,能够整合多个torrent追踪器的搜索结果,为qBittorrent、Deluge等各类P2P下载客户端提供统一的搜索接口,帮助用户更便捷地查找和获取所需资源;而LinuxServer.io团队凭借专业的容器化技术,确保该Jackett容器具备稳定的运行环境、简便的部署流程以及持续的更新支持,可满足用户在不同系统环境下高效使用Jackett的需求。
1.2千 次收藏10亿+ 次下载
9 小时前更新
linuxserver/tautulli logo

linuxserver/tautulli

LinuxServer.io 社区镜像
Tautulli Docker镜像是监控和分析Plex媒体服务器的工具,可跟踪用户活动、媒体播放统计及服务器性能,帮助用户掌握Plex使用情况。
433 次收藏5亿+ 次下载
2 天前更新
linuxserver/ombi logo

linuxserver/ombi

LinuxServer.io 社区镜像
LinuxServer.io提供的Ombi容器,用于管理媒体内容请求,支持用户申请电影、电视节目等媒体资源,适用于家庭媒体服务器环境。
467 次收藏5亿+ 次下载
9 小时前更新
linuxserver/plex logo

linuxserver/plex

LinuxServer.io 社区镜像
这是由LinuxServer.io为您提供的Plex Media Server容器,它是一款集成了Plex媒体服务器软件的轻量级、可移植Docker容器,能够帮助用户高效组织电影、音乐、照片等各类媒体文件,并支持跨设备流式传输与访问,适用于搭建个人或家庭媒体中心;LinuxServer.io作为专注开源容器开发的组织,致力于提供高质量、易于部署的容器镜像,此Plex Media Server容器便是其优质作品,为媒体管理与分享带来便捷体验。
2.1千 次收藏5亿+ 次下载
3 天前更新
linuxserver/plexpy logo

linuxserver/plexpy

LinuxServer.io 社区镜像
该镜像已弃用,建议使用linuxserver/tautulli镜像,现有数据可继续使用。
197 次收藏5000万+ 次下载
8 年前更新

查看更多 swag 相关镜像

更多相关 Docker 镜像与资源

以下是 linuxserver/swag 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:

  • library/nginx Docker 镜像说明
  • ilios/nginx Docker 镜像说明(Nginx Web 服务器,轻量高效)
  • ubuntu/nginx Docker 镜像说明(Nginx Web 服务器,基于 Ubuntu,适合生产环境)
  • bitnami/nginx Docker 镜像说明(Nginx Web 服务器,Bitnami 企业级配置,适合生产环境)
  • linuxserver/nginx Docker 镜像说明(Nginx Web 服务器,LinuxServer 维护版本,适合静态资源服务和反向代理)