Hideipnetwork / hideipnetwork-web

Based on Node.js + services wokers

Home Page:https://official.hideip.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

用nginx反代后,添加http auth显示Server Error

franocisgar opened this issue · comments

Internal Server Error
nginx.conf如下

    server {
        listen       443 ssl http2;
        server_name  localhost;

        ssl_certificate      CDNcert.pem;
        ssl_certificate_key  CDNkey.key;

        location / {
            proxy_pass http://127.0.0.1:56559;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection 'Upgrade';
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Host $host:$server_port;
            proxy_set_header X-Forwarded-Server $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            auth_basic "realm";
            auth_basic_user_file /etc/nginx/auth.txt;
        }
    }

相反,不添加http auth时就可以直接反代,如何解决?想私人或小部分范围访问。

hello, how do you solve it ?