Blog

wg-easy 的特点

  • 一键部署:通过 Docker 或 Docker Compose 直接拉起,几分钟即可用。
  • 可视化 UI 界面:再也不用手写配置文件,所有操作都能在网页端完成。
  • 用户/客户端管理:支持创建多个 VPN 客户端,自动生成配置文件和二维码。
  • 手机/PC 快速接入:扫描二维码即可导入 WireGuard 配置,零门槛上手。
  • 安全可靠:基于 WireGuard,性能高效,安全性有保障。
  • 适用场景广泛:远程办公、家庭快速组网、访问 NAS/智能家居,甚至自建加密代理。

前置环境

  1. 一台可以联网的 Linux 服务器
  2. 安装 Docker 和 Docker Compose
  3. 可用的公网 IP 或 域名

1. 下载WG-Easy源码

mkdir -p /opt/service/wg-easy && cd /opt/service/wg-easy

git clone https://github.com/wg-easy/wg-easy.git

《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图 — STARBUCKET BLOG

2. 安装WG-Easy

cd wg-easy
docker compose up -d

《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 2)— STARBUCKET BLOG

3. 初始化WG-Easy配置

《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 3)— STARBUCKET BLOG

创建账号 《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 4)— STARBUCKET BLOG

选择否 《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 5)— STARBUCKET BLOG

输入服务器IP/域名 《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 6)— STARBUCKET BLOG

《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 7)— STARBUCKET BLOG

使用https访问 《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 8)— STARBUCKET BLOG

4. 配置域名转发

server {
    listen 	443 ssl;
    listen  [::]:443 ssl;
    http2   on;
    server_name wireguard.demo.cn;
    
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
    add_header  X-XSS-Protection "1; mode=block";
    add_header  X-Content-Type-Options "nosniff";


    # ssl on;
    ssl_certificate 	/etc/nginx/ssl/demo.cn/server.pem;
    ssl_certificate_key /etc/nginx/ssl/demo.cn/server.key;

    ssl_protocols TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;

    ssl_session_cache shared:SSL:1m; # holds approx 4000 sessions
    ssl_session_timeout 10m;
    ssl_session_tickets off;
    ssl_buffer_size 4k;

    ssl_prefer_server_ciphers on;

    gzip            on;
    gzip_types      text/plain application/xml text/css application/javascript;
    gzip_min_length 1000;

    location ^~ / {
        proxy_redirect                      off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header Ali-CDN-Real-IP    $remote_addr;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_set_header X-NginX-Proxy      true;
        proxy_pass  http://WireGuard服务器IP:51821;
        proxy_read_timeout          10m;
        proxy_send_timeout          10m;
        proxy_connect_timeout       10m;
        proxy_busy_buffers_size 64k;
        proxy_buffers 4 32k;
        client_max_body_size 2000m;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Keep-Alive "timeout=1800, max=3600";
    }

}

nginx -s reload

使用域名访问,https://wireguard.demo.cn 《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 9)— STARBUCKET BLOG

《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 10)— STARBUCKET BLOG

5. 创建WG-Easy客户端

《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 11)— STARBUCKET BLOG

下载配置文件或扫码连接 《用WG-Easy量身定做轻量级可视化WireGuard-VPN远程利器》文章正文配图(配图 12)— STARBUCKET BLOG

Comments & discussion

The first comment in each thread opens a topic. Signed-in readers can keep the conversation going under that topic.

No comments yet. Sign in to start a topic.

Start a new topic

Sign in to start a topic or join the discussion.