- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Apache Karaf 中运行 soap Web 服务,我们使用的是 Apache CXF 2.7.6,JDK 是 1.7.0_80。我在 Centos 7 下的 Oracle VM Virtual box 上的笔记本电脑上的 docker 容器中运行以下命令
Apache Flex 中的 UI 调用以下 url 进行登录,我们收到以下错误:
http://my_virtual_machine_ip_address/usermanagementcxf/UserManagementService?wsdl结果从 Nginx 进入 502 Bad Gateway
在这里,请注意 Nginx 在 docker 内部运行,而托管 soap 服务的 Apache Karaf 不是在 docker 内部而是在 docker 外部运行,基本上是在本地运行。
能否请您告诉我在这里可以做些什么来解决这个问题?非常感谢这方面的任何帮助。
我还尝试了以下方法来解决这个问题:
root@a16807c2c955:/etc/nginx# cat nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
#gzip on;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
include /etc/nginx/default.d/*.conf;
location / {
}
}
}
root@a16807c2c955:/etc/nginx/default.d# cat myapplication.conf
resolver 127.0.0.1;
location /crossdomain.xml {
proxy_pass http://ls-httpd:8079/crossdomain.xml;
}
location /blazeds/ {
proxy_pass http://ls-blazeds:8089/blazeds/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
error_log /var/log/nginx/blazeds.error.log;
access_log /var/log/nginx/blazeds.access.log;
}
location /myapplicationcxf/ {
proxy_pass http://ls-services:8080/cxf/;
error_log /var/log/nginx/myapplication.error.log;
access_log /var/log/nginx/myapplication.access.log;
}
location /usermanagementcxf/ {
proxy_pass http://ls-services:8080/cxf/;
error_log /var/log/nginx/usermanagement.error.log;
access_log /var/log/nginx/usermanagement.access.log;
}
location /myapplicationtestcxf/ {
proxy_pass http://ls-services:8080/cxf/;
error_log /var/log/nginx/myapplicationtestcxf.error.log;
access_log /var/log/nginx/myapplicationtestcxf.access.log;
}
location /myapplicationadapt/ {
proxy_pass http://ls-httpd:8079/assets/;
error_log /var/log/nginx/myapplicationadapt.error.log;
access_log /var/log/nginx/myapplicationadapt.access.log;
}
location /myapplicationreports/ {
proxy_pass http://ls-httpd:8083/jasperreportpublisher/;
error_log /var/log/nginx/myapplicationreports.error.log;
access_log /var/log/nginx/myapplicationreports.access.log;
}
location /appname/ {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /appname {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /APPNAME/ {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /APPNAME {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /appnameapp/ {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /myapplication/ {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /myapplication {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /Myapplication/ {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
location /Myapplication {
proxy_pass http://ls-httpd:8079/;
error_log /var/log/nginx/appnameapp.error.log;
access_log /var/log/nginx/appnameapp.access.log;
}
[root@myhostname apache-karaf-2.3.3]# cat /etc/hosts
my_virtual_machine_ip_address ls-blazeds
my_virtual_machine_ip_address ls-services
my_virtual_machine_ip_address ls-mongo
my_virtual_machine_ip_address ls-activemq ls-queue01 ls-queue02
my_virtual_machine_ip_address ls-httpd
my_virtual_machine_ip_address ls-ldap
my_virtual_machine_ip_address ls-nginx
my_virtual_machine_ip_address myhostname
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 myhostname
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
root@fca3d332c76b:/var/log/nginx# tail -f access.log
172.17.0.1 - - [02/Dec/2016:12:54:00 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:12:54:00 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:13:06:54 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:13:06:54 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:13:07:00 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:14:54:33 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:14:54:35 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
10.0.2.15 - - [02/Dec/2016:14:54:41 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:14:55:17 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
172.17.0.1 - - [02/Dec/2016:14:55:29 +0000] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" "-"
^C
root@fca3d332c76b:/var/log/nginx# tail -f error.log
2016/12/02 14:54:33 [error] 9#9: *5 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2016/12/02 14:54:41 [error] 9#9: *7 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 10.0.2.15, server: _, request: "GET /favicon.ico HTTP/1.1", host: "10.0.2.15"
2016/12/02 14:55:17 [error] 9#9: *10 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "172.17.0.8"
2016/12/02 14:55:29 [error] 9#9: *13 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.17.0.1, server: _, request: "GET /favicon.ico HTTP/1.1", host: "172.17.0.1"
^C
root@fca3d332c76b:/var/log/nginx# tail -f usermanagement.access.log
10.0.2.15 - - [02/Dec/2016:14:49:50 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
10.0.2.15 - - [02/Dec/2016:14:54:14 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
10.0.2.15 - - [02/Dec/2016:14:54:17 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
10.0.2.15 - - [02/Dec/2016:14:54:41 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
172.17.0.1 - - [02/Dec/2016:14:55:17 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
172.17.0.1 - - [02/Dec/2016:14:55:29 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
10.0.2.15 - - [02/Dec/2016:14:55:37 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
10.0.2.15 - - [02/Dec/2016:14:55:51 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
172.17.0.1 - - [02/Dec/2016:14:56:02 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
10.0.2.15 - - [02/Dec/2016:14:56:07 +0000] "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1" 502 173 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
^C
root@fca3d332c76b:/var/log/nginx# tail -f usermanagement.error.log
2016/12/05 11:06:14 [error] 7#7: *25 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.2.15, server: _, request: "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1", upstream: "http://10.0.2.15:8080/cxf/UserManagementService?wsdl", host: "10.0.2.15"
2016/12/05 11:37:06 [error] 7#7: *1 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.2.15, server: _, request: "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1", upstream: "http://10.0.2.15:8080/cxf/UserManagementService?wsdl", host: "10.0.2.15"
2016/12/05 13:30:13 [error] 10#10: *4 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.2.15, server: _, request: "GET /usermanagementcxf/UserManagementService?wsdl HTTP/1.1", upstream: "http://10.0.2.15:8080/cxf/UserManagementService?wsdl", host: "10.0.2.15"
[username@myhostname nginx]# docker network inspect bridge
[
{
"Name": "bridge",
"Id": "9d6b9700358b5c79e27a29d700c8a6a71e07d15552106901fad6630e9bafdd23",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Containers": {
"18ab8f790aa52111184ce6fd83b22e3c09b89116502dd631a1357ba7f094277c": {
"Name": "ls-mongo",
"EndpointID": "9f0cf2d66909316396af4cee466f21ee2b9e5f82eee6e822c4ebab8422910cae",
"MacAddress": "02:42:ac:11:00:06",
"IPv4Address": "172.17.0.6/16",
"IPv6Address": ""
},
"24c98a655fecd973f5be8dbd92f3be4b85d7b3516c5e8808fceab3e37f527f4a": {
"Name": "ls-blazeds",
"EndpointID": "bc2002dbbdf38703bf2f0b46cf16c28e0f2c12d7ca64dc22070c0723c90ddff3",
"MacAddress": "02:42:ac:11:00:08",
"IPv4Address": "172.17.0.8/16",
"IPv6Address": ""
},
"918d4a4e1dba370f4b232b4e19bb2d6c7e894aea24d96e6fd960a717d8d6001d": {
"Name": "ls-activemq",
"EndpointID": "eeb75d2f1b18e9076d8d03a982c349072d32ec8bbcdba0d573270468121c5518",
"MacAddress": "02:42:ac:11:00:07",
"IPv4Address": "172.17.0.7/16",
"IPv6Address": ""
},
"93b1bcb9c2d1720f246b212e613ccd1b12f36b078637413147f09d5414302354": {
"Name": "ls-httpd",
"EndpointID": "3e910a7c354a4db935d6cf0a7457ba0c81e08492041e912108eda103e644454d",
"MacAddress": "02:42:ac:11:00:03",
"IPv4Address": "172.17.0.3/16",
"IPv6Address": ""
},
"a16807c2c955be35340c7f64f96c100904704e9fee40ca7c7737bcb358972636": {
"Name": "ls-nginx",
"EndpointID": "3ebce575049d46101ed50f217d0a61c2ad51a36dca33340cbcef09b00374536c",
"MacAddress": "02:42:ac:11:00:04",
"IPv4Address": "172.17.0.4/16",
"IPv6Address": ""
},
"e1ecc4ac677d7749fb18e78492941d64a71fb80448026f5abf86e70316f3295a": {
"Name": "nexus",
"EndpointID": "e3bfa1ab5427636709bddae75a3b7d45f8fb9e80410149f402ed597d18677b92",
"MacAddress": "02:42:ac:11:00:02",
"IPv4Address": "172.17.0.2/16",
"IPv6Address": ""
},
"f8efa4cb1a28b25895fbf6538c7fa02a0990cf28b8822056e82edbaf13975350": {
"Name": "ls-ldap",
"EndpointID": "b0388b3e1f242efdd11bd51e0bf8e31ffb609075583cbea5744a7c3d629f4cbd",
"MacAddress": "02:42:ac:11:00:05",
"IPv4Address": "172.17.0.5/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]
12/1/2016 17:38:29.225 [DEBUG] mx.messaging.Channel 'direct_http_channel' channel sending message:
(mx.messaging.messages::HTTPRequestMessage)#0
body = (Object)#1
clientId = (null)
contentType = "application/x-www-form-urlencoded"
destination = "DefaultHTTP"
headers = (Object)#2
DSRemoteCredentials = ""
DSRemoteCredentialsCharset = (null)
httpHeaders = (null)
messageId = "276C2438-DEED-3F9F-5567-BB7752E70224"
method = "GET"
recordHeaders = false
timestamp = 0
timeToLive = 0
url = "http://my_virtual_machine_ip_address/usermanagementcxf/UserManagementService?"
Warning: HTTP send request error, 12029: /ramplogicadapt/phpFunctions.php
12/1/2016 17:39:11.278 [INFO] mx.messaging.Producer '2304C2EF-FB83-9438-B164-BB7750A0E460' producer acknowledge of 'BAA0601B-0DDD-3FC3-DC17-BB775286490D'.
12/1/2016 17:39:11.281 [ERROR] mx.messaging.Producer '2304C2EF-FB83-9438-B164-BB7750A0E460' producer fault for 'BAA0601B-0DDD-3FC3-DC17-BB775286490D'.
Warning: HTTP send request error, 12029: /usermanagementcxf/UserManagementService?wsdl
12/1/2016 17:39:32.276 [INFO] mx.messaging.Producer '1D4C4F2A-BB9B-28FB-63B1-BB7752DF95B3' producer acknowledge of '276C2438-DEED-3F9F-5567-BB7752E70224'.
12/1/2016 17:39:32.280 [ERROR] mx.messaging.Producer '1D4C4F2A-BB9B-28FB-63B1-BB7752DF95B3' producer fault for '276C2438-DEED-3F9F-5567-BB7752E70224'.
Warning: HTTP send request error, 12002: /usermanagementcxf/UserManagementService?wsdl
12/1/2016 17:39:32.294 [INFO] mx.messaging.Producer 'DDAE8934-5315-F289-CF40-BB7752BCEE4C' producer acknowledge of 'CAC9A8B2-CF6D-3697-03EA-BB7752CF2FB6'.
12/1/2016 17:39:32.295 [ERROR] mx.messaging.Producer 'DDAE8934-5315-F289-CF40-BB7752BCEE4C' producer fault for 'CAC9A8B2-CF6D-3697-03EA-BB7752CF2FB6'.
12/1/2016 17:39:47.598 [DEBUG] mx.rpc.soap.Operation Queueing SOAP operation authenticateAndRegisterLogin
最佳答案
以下对我有用。如果您正在使用由 docker 创建并命名为 docker0 的以太网桥,您可以通过以 root 身份运行以下命令来设置以下转发规则:
引用: https://fralef.me/docker-and-iptables.html
https://unix.stackexchange.com/questions/178829/docker-container-not-able-to-ping-host
https://github.com/docker/docker/issues/24370
iptables rules break communication between Docker containers
关于apache - 502 Bad Gateway nginx/1.11.5 在 docker 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40958715/
我有一个无所事事的盒子,已经运行了一段时间,今天,由于某种原因,当我尝试重新启动nginx时,得到了以下提示。 nginx: [emerg] host not found in upstream "w
我注意到,当我使用 ubuntu 命令“nginx”启动 nginx 并执行 systemctl status nginx 时。它表明 systemctl 已禁用。此外,如果我首先使用命令 syste
我的 nginx 配置如下: proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $re
周围有两个配置文件,/etc/nginx/conf.d/default.conf和 /etc/nginx/nginx.conf,但是启用了哪一个呢?我运行的是 CentOS6.4 和 nginx/1.
我的 Nginx 配置仅适用于根位置,所有其他位置都返回“Cannot GET {location}”,其中位置是域后地址的其余部分。 这是我的/etc/nginx/sites-enabled/def
我在 nginx 中为 node.js 服务器设置了反向代理。 server { listen 80; server_name sub.domain.tld; location
我的应用程序将在两个位置提供静态文件,一个是/my/path/project/static,另一个是/my/path/project/jsutils/static。 我很难让网络服务器在两个目录中查找
我的域名注册商的 DNS 访问我的服务器并获取 nginx 默认页面,因此配置正确 我复制了一个当前正在工作的 nginx 虚拟主机,更改了 server_name和 conf 文件的名称,仅此而已。
这个问题在这里已经有了答案: Can't login in to phpPgAdmin (2 个回答) 3年前关闭。 我在centos中遇到了phpPgAdmin登录的奇怪问题,我做了所有需要的事情
我要为PoC进行的操作是向来自动态后端服务器的网页添加href。使用“ subs_filter”可以很容易地添加href,但是我需要使用响应中嵌入的信息来构造href。 是否可以使用LUA处理来自pr
我有网站服务器,它有两个代理(鱿鱼,CF),它们使用不同的 header 来获取真实的 ip。 我猜 nginx 命令 set_real_ip_from ;real_ip_header X-Forwa
在控制台显示如下: Job for nginx.service failed because the control process exited witherror code. See "syste
我有一个问题,我怀疑是 NGINX 问题。基本上,当我尝试登录到我创建的网站时,出现以下错误…… 您要查找的页面暂时不可用。请稍后再试。 有没有人以前遇到过这个? 最佳答案 如果 NGINX 虚拟主机
这是我的 nginx 配置文件: server { listen 80; server_name localhost; location / {
在我的/etc/nginx/nginx.conf 文件中,我有配置。作为:- user nginx; worker_processes 1; error_log /var/log/nginx/e
有谁知道nginx支持软退出吗?这意味着它会一直运行直到所有连接都消失或超时(超过特定时间间隔)并且在此期间也不允许新连接吗? 例如: nginx stop nginx running (2 conn
有没有办法将 Nginx 配置为类似这样的直接服务器返回 (DSR) 负载平衡器: http://blog.haproxy.com/2011/07/29/layer-4-load-balancing-
我通过 apt-get 安装了 Nginx不久前在 Debian 上,我有几个网站在上面。现在我需要安装一些额外的模块,因为我不想搞砸任何事情,所以我想在执行之前仔细检查我的过程。希望这也能帮助其他不
我知道 Apache 的 pagespeed 模块可以使页面访问更快,所以,我想知道 Nginx 是否有等效的模块? 提前致谢! 最佳答案 https://github.com/pagespeed/n
如何将worker_rlimit_nofile设置为一个更大的数字,它可以是或建议最大为多少? 我正在尝试遵循以下建议: 大多数人遇到的第二个最大限制是 与您的操作系统有关。打开一个shell,su给
我是一名优秀的程序员,十分优秀!