? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

🌱Vpei ZeroNet Blog

🍒Vpei 🍒 ZeroID 🍒

Follow in NewsfeedFollowing

Latest comments:

Add new post

Title

21 hours ago · 2 min read ·
3 comments
Body
Read more

Not found

VPS+NGINX+ZERONET网站代理多帐号同时登录的使用

on Apr 02, 2018

本地解压ZERONET文件至文件夹,想同时登录几个帐号就多复制几份,找到zeronet.exe文件创建快捷方式,在快捷方式中设置参数。
如:\ZeroNet.exe --ui_port 43111 --fileserver_port 15442
设置好参数后,只要两个端口号不重复,建议直接加一个数字。这样就可以打开不同的客户端。这样本地就可以同时登录多个帐号。

远程访问:
http://www.tk可以多注册几个免费域名,再根据我之前的文章申请证书等(有证书主要是加密传输,不用证书也可以)。

server {
域名1对应帐号1,及设置参数
}
server {
域名2对应帐号2,及设置参数
}
server {
域名3对应帐号3,及设置参数
}
server {
域名4对应帐号4,及设置参数
}
...... 只要服务器配置没问题,可以搞足够多的帐号

NGINX参数按下面写:

    #域名www.domain1.tk绑定本地网址http://127.0.0.1:43111
    server {
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name www.domain1.tk;
        access_log off;

        #以下为密码认证配置
        #用户密码文件htpasswd,放入配置文件所在的文件夹
        auth_basic "user and password !";
        auth_basic_user_file htpasswd; 
        #以上为密码认证配置

        #ssl_certificate /website/userssl/ssl.crt;
        #ssl_certificate_key /website/userssl/ssl.key;
        #证书文件获取网址 https://freessl.org/,文件下载解压后的文件夹chain放入软件目录
        ssl_certificate      ./chain/full_chain.pem;
        ssl_certificate_key  ./chain/private.key;
        ssl_session_timeout 5m;


        location / {
            proxy_pass http://127.0.0.1:43111;
        }

        location /Websocket {
            proxy_pass http://127.0.0.1:43111;
            proxy_http_version 1.1;
            proxy_read_timeout 1h; #for long live websocket connetion
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

        if ($scheme = http) {
            return 301 https://$server_name$request_uri;
        }
    }

    #域名www.domain2.tk绑定本地网址http://127.0.0.1:43112
    server {
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name www.domain2.tk;
        access_log off;

        #以下为密码认证配置
        #用户密码文件htpasswd,放入配置文件所在的文件夹
        auth_basic "user and password !";
        auth_basic_user_file htpasswd; 
        #以上为密码认证配置

        #ssl_certificate /website/userssl/ssl.crt;
        #ssl_certificate_key /website/userssl/ssl.key;
        #证书文件获取网址 https://freessl.org/,文件下载解压后的文件夹chain放入软件目录
        ssl_certificate      ./chain/full_chain.pem;
        ssl_certificate_key  ./chain/private.key;
        ssl_session_timeout 5m;


        location / {
            proxy_pass http://127.0.0.1:43112;
        }

        location /Websocket {
            proxy_pass http://127.0.0.1:43112;
            proxy_http_version 1.1;
            proxy_read_timeout 1h; #for long live websocket connetion
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

        if ($scheme = http) {
            return 301 https://$server_name$request_uri;
        }
    }

0 Comments:

user_name1 day ago
Reply
Body
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More