- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在登录 Wildfly 13 管理控制台
后收到错误消息需要身份验证
。
如果我输入错误的用户名或密码,它会再次询问,但如果我输入正确,它会显示带有错误消息的页面(所以我假设用户名和密码是正确的,但之后的其他内容会给出错误)。
我正在使用 docker 来运行一个 nginx 容器和一个 wildfly 容器。
nginx 在端口 9991
上进行外部监听,代理将请求传递给 wildfly 容器,但它显示之前描述的错误。
它只发生在 Wildfly 控制台,所有其他请求都被代理,甚至请求被代理到 websocket 或端口 8080
上的 Wildfly,都成功完成.
Wildfly 容器在端口 9990
上进行外部监听,我可以在此端口成功访问控制台。如果在 docker 上,我映射端口 "9992:9990"
我仍然可以通过端口 9992
成功访问控制台。
所以,这似乎与docker无关,而是与Wildfly Console本身有关。可能在中间使用反向代理时无法成功进行某种身份验证。
我在 https://github.com/lucasbasquerotto/pod/tree/0.0.6 上有一个演示 docker 项目,您可以下载标签 0.0.6,该标签的所有设置都可以与 Wildfly 13 和 nginx 一起使用,并模拟此错误。
git clone -b 0.0.6 --single-branch --depth 1 https://github.com/lucasbasquerotto/pod.git
cd pod
docker-compose up -d
然后,如果您使用用户 monitor
和密码 Monitor#70365
直接在 http://localhost:9990
中访问容器 一切正常。
但如果您使用相同的凭据访问 http://localhost:9991
,通过 nginx 反向代理,您会收到错误。
我的 nginx.conf
文件:
upstream docker-wildfly {
server wildfly:9990;
}
location / {
proxy_pass http://docker-wildfly;
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 X-Forwarded-Host $server_name;
}
我也尝试过:
proxy_set_header X-Forwarded-Proto $scheme;
还有 Authorization header(只是第二行,也有两行):
proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;
并且还定义了带有端口的主机 header (而不仅仅是$host):
proxy_set_header Host $server_addr:$server_port;
我已经尝试将上述配置分开并组合在一起。一切都无济于事。
有什么建议吗?
有没有人通过反向代理成功访问过Wildfly控制台?
Wildfly 似乎使用了摘要式身份验证(而不是基本身份验证)。
我在控制台中看到标题如下:
Authorization: Digest username="monitor", realm="ManagementRealm", nonce="AAAAAQAAAStPzpEGR3LxjJcd+HqIX2eJ+W8JuzRHejXPcGH++43AGWSVYTA=", uri="/console/index.html", algorithm=MD5, response="8d5b2b26adce452555d13598e77c0f63", opaque="00000000000000000000000000000000", qop=auth, nc=00000005, cnonce="fe0e31dd57f83948"
我没有看到太多关于使用 nginx 来代理带有摘要 header 的传递请求的文档(但我认为它应该是透明的)。
我在 SO 中看到的一个问题是 https://serverfault.com/questions/750213/http-digest-authentication-on-proxied-server , 但目前还没有答案。
看到有nginx非官方模块https://www.nginx.com/resources/wiki/modules/auth_digest/ ,但在 github 存储库 ( https://github.com/atomx/nginx-http-auth-digest ) 中它说:
The ngx_http_auth_digest module supplements Nginx's built-in BasicAuthentication module by providing support for RFC 2617 DigestAuthentication. The module is currently functional but has only beentested and reviewed by its author. And given that this is securitycode, one set of eyes is almost certainly insufficient to guaranteethat it's 100% correct. Until a few bug reports come in and some ofthe ‘unknown unknowns’ in the code are flushed out, consider thismodule an ‘alpha’ and treat it with the appropriate amount ofskepticism.
在我看来,硬编码用户并传入一个文件以供 nginx 使用(在这种情况下,身份验证应该对反向代理透明)。
无论如何,我都试过了,它正确地要求我进行身份验证,即使最终目的地没有摘要式身份验证,比如在尝试连接到 wildfly 站点(不是控制台)时,它会在尝试连接时询问到 nginx(在代理请求之前),然后它成功转发到目的地,除了在 wildfly 控制台的情况下,它一直要求我永远进行身份验证。
所以我认为这不是解决方案。问题似乎在于 nginx 传递给 Wildfly 控制台的内容。
最佳答案
我在 HAL 管理控制台 v3.3 和 3.2 上遇到了同样的问题由于身份验证错误,我无法让 ngnix HTTPS 工作,即使页面提示 http basic auth user and pass
这是在同一台服务器上以独立模式测试的
我的设置是:外部 (https) -> nginx -> http://halServer:9990/这导致 https 正常工作,但出现 HAL 身份验证错误(在浏览器控制台中看到),网页为空白。一开始访问网页会正常询问http basic auth凭据,但后来几乎所有的https请求都会返回一个认证错误
我首先使用自签名证书启用 HAL 控制台 https,然后配置 nginx 以代理传递给 HAL HTTPS 监听器,从而使其正常工作
工作设置是:外部 (https) -> nginx (https) -> https://halServer:9993/
这是ngnix配置
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name halconsole.mywebsite.com;
# SSL
ssl_certificate /keys/hal_fullchain.pem;
ssl_certificate_key /keys/hal_privkey.pem;
ssl_trusted_certificate /keys/hal_chain.pem;
# security
include nginxconfig.io/security.conf;
# logging
access_log /var/log/nginx/halconsole.mywebsite.com.access.log;
error_log /var/log/nginx/halconsole.mywebsite.com.error.log warn;
# reverse proxy
location / {
# or use static ip, or nginx upstream
proxy_pass https://halServer:9993;
include nginxconfig.io/proxy.conf;
}
# additional config
include nginxconfig.io/general.conf;
include nginxconfig.io/letsencrypt.conf;
}
# subdomains redirect
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name *.halconsole.mywebsite.com;
# SSL
ssl_certificate /keys/hal_fullchain.pem;
ssl_certificate_key /keys/hal_privkey.pem;
ssl_trusted_certificate /keys/hal_chain.pem;
return 301 https://halconsole.mywebsite.com$request_uri;
}
代理配置文件
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Forwarded $proxy_add_forwarded;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-By $server_addr;
# Proxy timeouts
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
启用 https 控制台的最简单方法是使用控制台本身
使用命令行 keytool
或 GUI 程序生成 java JKS keystore 我喜欢 GUI,所以我使用了 Key Store Explorer https://github.com/kaikramer/keystore-explorer
将 keystore 文件复制到具有读取权限的 halServer 服务器上(无需保密)我将我的 keystore 文件放在“ keystore ”目录中的 wildfly 数据目录中。
# your file paths might differ, don't copy paste
cp /home/someUser/sftp_uploads/managementKS /opt/wildfly/standalone/data/keystore/managementKS
# your file paths might differ, don't copy paste
chown --recursive -H wildfly:wildfly /opt/wildfly/standalone/data/keystore
(使用vpn)登录明文控制台http://halServer:9990/
添加 keystore :导航:
configuration -> subsystems -> security (elytron) -> other settings (click view button)
stores -> keystore -> add
...
Name = managementKS
Type = JKS
Path = keystore/managementKS
Relative to = jboss.server.data.dir
Credential Reference Clear Text = keystore-password click Add
结果为 standalone.xml
<key-store name="managementKS">
<credential-reference clear-text="keystore-password"/>
<implementation type="JKS"/>
<file path="keystore/managementKS" relative-to="jboss.server.data.dir"/>
</key-store>
添加 key 管理器:导航:
ssl -> key manager -> add
...
Name = managementKM
Credential Reference Clear Text = keystore-password
Key Store = managementKS
结果为 standalone.xml
<key-manager name="managementKM" key-store="managementKS">
<credential-reference clear-text="keystore-password"/>
</key-manager>
添加 ssl 上下文:导航:
ssl -> server ssl context -> add
...
Name = managementSSC
Key Manager = managementKM
...
Edit added : Protocols = TLSv1.2
save
结果为 standalone.xml
<server-ssl-contexts>
<server-ssl-context name="managementSSC" protocols="TLSv1.2" key-manager="managementKM"/>
</server-ssl-contexts>
返回
runtime -> server (click view button)
http management interface (edit)
set secure socket binding = management-https
set ssl context = managementSSC
save
重启野蝇
systemctl restart wildfly
关于docker - 访问 Wildfly 管理控制台时出错 - 需要身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52452474/
我正在使用以下dockerfile: FROM ubuntu:14.04 MAINTAINER xxx xxx # SSH RUN apt-get update && apt-get install
我运行了docker-compose build celery,(经过数小时的尝试,我的连接不良)成功了。 app Dockerfile的前80%是相同的,但不会重复使用缓存。从我可以浏览的内容来看,
我可以使用以下命令成功创建 Docker 注册表 v2 服务:docker service create 然后我使用 docker Push 将一些图像推送到该服务。 当我通过 curl localh
我正在尝试使用 gitlab 构建 CI,我从 docker 的 docker 镜像开始,我的前端存储库没有任何问题,但现在使用相同的 gitlab-ci 配置文件,我有此守护程序错误。 这是构建的输
用例: 我们在 Jenkins 中有几个“发布作业”build 和 push 应用程序的 Docker 镜像到 docker registry,更新各种文件中的项目版本,最后将发布标签推送到相应的 G
当我尝试构建我的 docker 文件时,docker 返回以下错误: [+] Building 0.0s (1/2)
docker-in-docker 的作者在此博客中建议不要将此图像用于 CI 目的: jpetazzo/Using Docker-in-Docker for your CI or testing en
我创建了一个 Dockerfile 来在 Docker 中运行 Docker: FROM ubuntu:16.04 RUN apt-get update && \ apt-get in
我尝试为 Docker 镜像定位一个特定标签。我怎样才能在命令行上做到这一点?我想避免下载所有图像,然后删除不需要的图像。 在 Ubuntu 官方版本中,https://registry.hub.do
我正在尝试在docker中运行docker。唯一的目的是实验性的,我绝不尝试实现任何功能,我只想检查docker从另一个docker运行时的性能。 我通过Mac上的boot2docker启动docke
docker-compose.yml version: "3" services: daggr: image: "docker.pvt.com/test/daggr:stable"
我有一个非常具体的开发环境用例。在一些代码中,我启动了一个容器来抓取页面并检索在容器中运行的服务(Gitlab)的 token 。 现在,我希望 Dockerize 运行它的代码。具体来说,类似: o
之前已经问过这个问题,但我不确定当时是否可以使用docker-compose文件完成docker堆栈部署。 由于最新版本支持使用compose将服务部署到堆栈,因此,我无法理解dab文件的值。 我检查
我在一次采访中被问到这个问题,但无法回答。也没有找到任何相关信息。 最佳答案 正如 Docker 文档中所述,Docker 注册表是: [...] a hosted service containin
有没有一种方法可以将具有给定扩展名的所有文件复制到Docker中的主机?就像是 docker cp container_name:path/to/file/in/docker/*.png path/o
我的日志驱动程序设置为journald。使用日志记录驱动程序时,daemon.json文件中的日志级别配置会影响日志吗?使用docker logs 时仅会影响容器日志? 例如,docker和journ
我最近开始使用Docker + Celery。我还共享了full sample codes for this example on github,以下是其中的一些代码段,以帮助解释我的观点。 就上下文
运行docker build .命令后,尝试提交构建的镜像,但收到以下错误 Step 12 : CMD activator run ---> Using cache ---> efc82ff1ca
我们有docker-compose.yml,其中包含Kafka,zookeeper和schema registry的配置 当我们启动docker compose时,出现以下错误 docker-comp
我是Docker的新手。是否可以在Docker Hub外部建立Docker基本镜像存储库?假设将它们存储在您的云中,而不是拥有DH帐户?谢谢。 最佳答案 您可以根据需要托管自己的注册表。可以在Depl
我是一名优秀的程序员,十分优秀!