- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在将 jwilder/nginx-proxy 与 cloudflare ssl(原始 key ,完整类型 SSL)一起使用时遇到问题。
在我激活 Cloudflare 的 DNS 代理之前,一切正常(在 http 中)。服务器返回 521(Web 服务器关闭)。
这是我的 docker-compose.yaml
version: "2"
services:
nginx-proxy:
image: jwilder/nginx-proxy:alpine
ports:
- 80:80
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./certs:/etc/nginx/certs
network_mode: bridge
saraswati-global:
image: asia.gcr.io/ordent-production/ordent/saraswati-global
ports:
- 3000:3000
environment:
- VIRTUAL_HOST=beta.saraswati.global
- VIRTUAL_PORT=3000
- VIRTUAL_PROTO=https
network_mode: bridge
api-healed-id:
image: asia.gcr.io/ordent-production/ordent/api.healed.id
ports:
- 4001:4001
environment:
- VIRTUAL_HOST=dev.healed.id
- VIRTUAL_PORT=4001
- VIRTUAL_PROTO=https
network_mode: bridge
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
default $http_x_forwarded_port;
'' $server_port;
}
# If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any
# Connection header that may have been passed to this server
map $http_upgrade $proxy_connection {
default upgrade;
'' close;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
ssl_dhparam /etc/nginx/dhparam/dhparam.pem;
# Set appropriate X-Forwarded-Ssl header
map $scheme $proxy_x_forwarded_ssl {
default off;
https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log off;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:D
ssl_prefer_server_ciphers off;
resolver 172.26.0.2;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
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 $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
server {
server_name _; # This is just an invalid value which will never trigger on a real hostname.
listen 80;
access_log /var/log/nginx/access.log vhost;
return 503;
}
# beta.saraswati.global
upstream beta.saraswati.global {
## Can be connected with "bridge" network
# ordent-production-host_saraswati-global_1
server 172.17.0.3:3000;
}
server {
server_name beta.saraswati.global;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass https://beta.saraswati.global;
}
}
# dev.healed.id
upstream dev.healed.id {
## Can be connected with "bridge" network
# ordent-production-host_api-healed-id_1
server 172.17.0.4:4001;
}
server {
server_name dev.healed.id;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass https://dev.healed.id;
}
}
最佳答案
当您定义 nginx-proxy 服务时,会导致此问题:
ports:
- 80:80
当您在 Cloudflare 上启用 SSL 时,默认端口将为 443,而不是 80。
ports:
- 443:443
关于docker - 带有 cloudflare SSL 的 jwilder/nginx-proxy 没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61503478/
我知道我真的很接近这个,但我无法得到最后一部分 在职的。我几乎可以肯定它与 WordPress 有关 容器和 PHP 容器需要在同一个目录下吗?所以 PHP可以处理那个目录下的文件吗?我一直在努力 一
我正在尝试使用nginx-proxy docker容器,但是如果我指向没有子域的域(mydomain.com),那么我只会得到欢迎页面。我正在使用Docker-Compose,而我的.yml文件如下所
我有3个(app-client,app-a,app-b)应用程序在 jetty 服务器中运行,并且有一个NGINX负载均衡器(app-lb)。所有(内部或外部)请求都通过负载平衡器到达我的应用程序。
我正在尝试使用 docker-compose、jwilder/nginx-proxy 和 letsencrypt companion 构建一个 Web 应用程序,但是当我尝试它时,nginx 向我抛出
在更新dockeron版本18.03.0-ce-win59(16762)之后,jwilder / nginx-proxy无法运行。 我目前正在使用WINDOWS 10和DOCKER版本:18.03.0
我有一个 Web 应用程序(由 uwsgi 提供的 django),我正在使用 nginx 代理对特定容器的请求。 这是我的 default.conf 中的相关片段。 upstream web.ubu
我是新来的。 我在反向代理(jwilder的Docker / nginx-letsencrypt)后面有一个gitlab CE(Docker)的奇怪错误,当图像端口80和443直接映射到主机端口时,相
在我的架构中,我在我的 docker 中使用/jwilder/nginx-proxy 作为代理服务器,然后我使用 MySQL 和 WordPress 安装了 3 个 WordPress 网站。 它们运
我正在使用 https://github.com/jwilder/nginx-proxy用于 nginx-proxy 设置 端口 80 重定向正在工作。这意味着我可以使用 test.example.c
我通过 boot2docker 在 osx 上使用 docker . 我有 2 个主机:site1.loc.test.com和 site2.loc.test.com指向docker主机的ip地址。 两
我是Docker的新手,发现一件事我不理解:我从Github存储库nginx-proxy/nginx-proxy下载了图像jwilder/nginx-proxy,并使用docker-compose u
我正在尝试将jwilder/nginx-proxy设置为反向代理,以将请求代理到公开VIRTUAL_HOST = example.com环境变量的各种容器。 如果容器是直接从ec2群集主机上启动的,则
我正在使用 jwilder/nginx-proxy单独的 docker-compose.yaml .它看起来像这样: proxy: image: jwilder/nginx-proxy r
我正在对一些网站进行容器化。我希望能够迁移一些重写规则,以自动在请求中的域名中附加或删除 www。 在jwilder/nginx-proxy Docker 容器中的方式/位置 nginx.tmpl或者
我尝试将以下内容添加到 my_proxy.conf 文件中,该文件被安装到容器中的 /etc/nginx/conf.d/ 中,如 https://github.com/jwilder/nginx-pr
我使用jwilder/nginx-proxy做一个反向代理。我尝试将 http://localhost:8000/api 重定向到特定的 php 服务。 目录结构: . +-- docker-comp
我们正在努力通过 SSL 使用单个端口和 jwilder/nginx-proxy 设置多个网站托管,我们能够在没有 ssl 的情况下部署解决方案并且它工作正常但是当我们尝试使用 SSL 时它失败了HT
我在将 jwilder/nginx-proxy 与 cloudflare ssl(原始 key ,完整类型 SSL)一起使用时遇到问题。 在我激活 Cloudflare 的 DNS 代理之前,一切正常
我在 Docker 中创建了一个新的 Laravel 项目,并且正在为我的项目创建一个 VirtualHost 域名。 我的 docker-compose.yml 看起来像这样。 version: '
我正在尝试按照以下指南在Docker上设置Elasticsearch集群:https://sematext.com/blog/2016/12/12/docker-elasticsearch-swarm
我是一名优秀的程序员,十分优秀!