Tag: 反向代理

无法从apache访问php-fpm容器

我在我的Ubuntu机器上安装了最新的Nextcloud容器。 它使用以下命令成功启动: sudo docker run –name nextcloud –link mysql:mysql -p 9000:9000 -v /data/nextcloud:/var/www/html -d nextcloud:latest 命令sudo docker logs nextcloud显示: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using […]

Nginx反向代理背后的Nginxconfiguration

我有一个带有Docker的Nginx,用于使用HTTP和HTTPS的开发环境,具体configuration如下: listen 80; listen 443 ssl; set_real_ip_from 10.0.0.0/8; real_ip_header X-Real-IP; real_ip_recursive on; location / { try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } location ~ ^/(app|app_dev|app_test|config)\.php(/|$) { fastcgi_pass php-upstream; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS $https; } 我想testing我的本地环境中的HTTP和HTTPS,但在生产中,我有一个Nginx反向代理前面: upstream app_upstream { server app:80; } server { server_name $APP_DOMAIN; […]

Apacheconfigurationredirect到不同的主机和端口的stream量

我有一个dockerregistry设置,其中我有两个服务器。 Server1:Apache webserver只是为了重新引导stream量Server2:实际的dockerregistry。 registryparsing端口8081。 以下是我可以使用反向代理并将stream量发送到Server2的apacheconfiguration。 但是,这只适用于端口8081.我已经托pipe多个回购下的registry,使用几个端口,例如:8082.8083,8084等。我如何重新指导从同一端口的Apachenetworking服务器的stream量到dockerreigistry服务器。 server1:8082 – > server2:8082 server1:8083 – > server2:8083 <VirtualHost *:443> SSLEngine on SSLCertificateFile /etc/apache2/ssl/crt/cert.cer SSLCertificateKeyFile /etc/apache2/ssl/key/cert.key #ServerAdmin webmaster@localhost ProxyRequests Off ProxyPreserveHost On AllowEncodedSlashes NoDecode <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://server2:8081/ nocanon ProxyPassReverse / http://server2:8081/ #ProxyPassReverse / http://www.example.com/ RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port […]

从Docker容器内部,如何连接到本机的本地主机?

所以我有一个在Docker容器中运行的Nginx,我有一个运行在本地主机上的mysql,我想从我的Nginx中连接到MySql。 MySql是在本地主机上运行的,而不是向外界公开一个端口,所以它绑定在本地主机上,不绑定在机器的IP地址上。 有没有办法从这个docker集装箱连接到这个MySql或本地主机上的任何其他程序?

客户端无法通过nginx反向代理连接(https)到WebSocket服务器

我们的用例是一个托pipe在Docker容器中的web应用程序。 这个容器有一个Web服务器和一个WebSocket服务器,这两个服务器都使用托pipe在另一个Docker容器中的nginx反向代理从客户端传递请求。 我们使用的是一个nginx反向代理,因为并不是所有的webapp实例都需要HTTPS,但是,如果需要HTTPS,我们需要一个服务器来接受SSL连接,而不需要修改webapp Docker容器中的代码。 websocket连接打开如下: url={`wss://${this.props.root}websocket`} 其中${this.props.root}等同于example.com/ ,它根据托pipe服务器的域来进行更改。 反向代理通过将所有对服务器的请求传递给webapp的docker容器来处理所有请求 location / { proxy_pass http://___APPLICATION_IP___:___APPLICATION_PORT___; proxy_http_version 1.1; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Upgrade $http_upgrade; proxy_redirect off; proxy_set_header Connection "upgrade"; proxy_read_timeout 60s; } 然而,虽然经常性的请求(即通过普通的HTTP / GET传递的css和html数据)工作正常(我可以看到网站的用户界面),但是需要websocket的function却不起作用。 当我使用浏览器控制台时,它说: Firefox can't establish a connection to the server at wss://{test-domain-omitted-here}/websocket. 任何想法,我们可能会错过什么?

Nextcould 11 docker“config.php”不起作用

我正在使用通过Centos 7 Cockpit GUI部署的官方Nextcould 11 docker ,并通过Nginx HTTPS reverse proxy with Let's Encrypt安装的Nginx HTTPS reverse proxy with Let's Encrypt访问。 一切顺利,但我不能断开 。 罪魁祸首 :生成的URL实际上是容器的内部地址。 如果我手动replace该URL的主机部分,所有的作品。 所以,我创build了一个config.php文件到/ config目录,其中包含给定的参数: <?php $CONFIG = array ( "overwritehost" => "sub.url.fr", "overwriteprotocol" => "https", ); 当我重新启动容器时,没有任何变化。 那么,我该做什么才能在该docker集装箱中的config.php中进行更改? 预先感谢您的答复。 最好的祝福。

docker自定义networking连接之间拒绝

我configuration了一个自定义的networking,我把3个容器放在里面: Nginx的反向代理,它发布80和443端口 cadvisor gitlab 全部在my_dockernetworking中 在启动nginx的时候,从nginx容器里面得到connexion拒绝给别人的容器: wget gitlab Connecting to gitlab (172.18.0.2:80) wget: can't connect to remote host (172.18.0.2): Connection refused wget cadvisor:8080ex Connecting to cadvisor:8080 (172.18.0.4:80) wget: can't connect to remote host (172.18.0.4): Connection refused 所以nginx不能服务于任何网站。 进入gitlab容器之后,执行: root@gitlab:/# wget https://nginx –2017-05-12 08:19:20– https://nginx/ Resolving nginx (nginx)… 172.18.0.3 Connecting to nginx (nginx)|172.18.0.3|:443… connected. ERROR: no […]

nginx的default_site似乎没有工作

我已经将docker中的nginx作为反向代理运行了一段时间,而且它运行起来非常奇妙,缺less一个我最近看到的小问题。 我想要的是:当用户到达我的nginx服务器并且没有为该URL指定一个.conf文件时,404/444或其他一些HTTP连接丢失的响应。 我所看到的:当用户导航到sudomain.url.com并且该子域未在我的任何* .conf文件中指定时,nginx使用它find的第一个conf文件 – 忽略default.conf。 在下面find我的细节。 任何其他的提示/技巧,你可以提供将是真棒! nginx.conf: user nginx; worker_processes 1; error_log /etc/nginx/log/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 /etc/nginx/log/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 70; #gzip on; include […]

nginx反向代理泊坞窗 – 按位置过滤

我正在关注这篇文章http://jasonwilder.com/blog/2014/03/25/automated-nginx-reverse-proxy-for-docker/我想知道如何“ 过滤 ”的位置(检查URL)的请求可以成立。 例如,当请求进入www.example.com/a时,它将进入容器A,当请求到达www.example.com/b时,它将被redirect到容器B.

在Docker上创buildNGINX逆向代理并向其他容器中的网站发送请求时出错

我目前正在尝试使用docker创build一个NGINX反向代理服务器,它将接受来自Web的代理服务器的请求,然后将请求redirect到一个容器,并与我想要在线的网站连接。 所以我目前有2个容器,一个用于Nginx的反向代理,另一个包含Nginx的LEMP和我的网站文件。 出于某种原因,我不断得到一个502错误的网关错误。 我已经单独testing了网站容器(直接连接到网站而不是通过代理),网站正确显示。 另外,我使用'wget'来testingterminal的连通性,而且网站容器从任何地方连接正确,但是当试图使用'wget'来访问Nginx代理容器时,它也显示502错误的网关错误。 我对web dev很新,所以我很感激任何帮助,因为我可能只是错过了一些简单的东西。 Nginx反向代理configuration文件 server { listen 80 default_server; listen [::]:80 default_server; # include snippets/snakeoil.conf; root /var/www/html; index index.html index.php index.htm index.nginx-debian.html; server_name 138.197.67.44; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; proxy_set_header […]