反向代理

如下 nginx 配置:

server {
    listen 80;
    server_name flower.example.com;
    charset utf-8;

    location / {
        proxy_pass http://localhost:5555;
        proxy_set_header Host $host;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

请注意,你不应该让这个网站暴露在公众互联网,而无需任何形式的认证!如果你有用户`htpasswd`文件凭据可以使`nginx`使用该文件中加入以下 的位置块:

auth_basic "Restricted";
auth_basic_user_file htpasswd;

上一个主题

认证

下一个主题

Docker 用法