使用nginx的flinkwebui身份验证

tyky79it  于 2021-06-24  发布在  Flink
关注(0)|答案(1)|浏览(566)

我正在尝试使用将身份验证添加到web Jmeter 板 nginx . Flink的 rest.port 设置为 8081 ,防火墙已禁用与此端口的连接。我在用 nginx 侦听端口8080上的请求,并使用用户名/密码身份验证将请求重定向到端口8081(端口8080已打开)。
这就是服务器块在中的样子 nginx.conf .

server {
    listen       8080;
    server_name  localhost;

    include /etc/nginx/default.d/*.conf;

    location / {
    proxy_pass https://localhost:8081;
        auth_basic           "Administrator's Area";
        auth_basic_user_file /etc/apache2/.htpasswd;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}

端口重定向工作正常,但有几个问题。当我转到非活动作业管理器的ui时,不会重定向到活动作业管理器。当我尝试从ui提交一个作业时,上传会陷入“保存”状态。

yi0zb3m4

yi0zb3m41#

试试这个:

location / {
    auth_basic           "Administrator's Area";
    auth_basic_user_file /etc/apache2/.htpasswd;

    include proxy_params;
    proxy_pass http://localhost:8081;
}

您需要使用proxy\u set\u header….,它包含在proxy\u params、ing/etc/nginx中,

相关问题