question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using nginx-proxy with cloudflare full ssl config

See original GitHub issue

I’m unable to use cloudflare with nginx-proxy. Because I’m using full ssl config (which requires HTTPS connection between server and cloudflare) there’s something that’s not working.

Here’s simple network graph:

                                                                          +----HTTP----> Virtual host 1
                                                                          |
User ------ HTTPS -----> Cloudflare ------ HTTPS ------> nginx-proxy -----|----HTTP----> Virtual host 2
                                                                          |
                                                                          +----HTTP----> Virtual host 3

Here’s my compose config:

version: '3.4'

services:
  db:
    image: mdillon/postgis
    volumes:
      - "/var/docker/postgresql/.sock:/var/run/postgres/postgres.sock"
      - "/var/docker/postgresql/data:/var/lib/postgresql/data"
      - "/var/docker/postgresql/initdb:/docker-entrypoint-initdb.d/"

  proxy:
    image: jwilder/nginx-proxy
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
      - "/var/docker/certs:/etc/nginx/certs"
    ports:
      - "80:80"
      - "443:443"

# virtual servers ...

Result:

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

6reactions
themisircommented, Aug 20, 2020

@TheMisir I am struggling with the same right now.

Can you guide me on how you named your .pem, .key and .cert files? And what environment vars did you have to set on your containers?

I issued origin certificates for domain.com and *.domain.com then I get only one certificate for root domain and subdomains. Renamed certificate to “domain.com.crt” (not .pem) and key to “domain.com.key” (as described here).

I hope it works. If it doesn’t:

What I did next is I’m not sure it really helped or not but I think worth trying.

image

I turned on then off the switch labeled “Authenticated Origin Pulls”. And website become available after doing that but I’m not sure if it was really helped.

1reaction
themisircommented, Jul 25, 2020

Also, did you setup docker-letsencrypt-nginx-proxy-companion? It’s missing from the configuration you posted.

No I have not installed “docker-letsencrypt-nginx-proxy-companion”.

The issue was solved by itself after a few days. I think the issue is related to cloudflare cache.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Host a Website Using Cloudflare and Nginx on ...
Now go to the Cloudflare dashboard's SSL/TLS section, navigate to the Overview tab, and change SSL/TLS encryption mode to Full (strict). This ...
Read more >
Configure NGINX + CloudFlare + SSL - Stack Overflow
My host is running Ubuntu 16.04 LTS · I am currently using CloudFlare's Universal SSL (free tier) · I have my test host...
Read more >
Reverse proxy via nginx - CloudFlare SSL - Security
I made a Reverse proxy through Nginx and I need to have it under Cloudflare proxy. ... It should be set on the...
Read more >
How to setup SSL/TLS for your domain for Free: Cloudflare ...
You need to enable this from the Cloudflare SSL dashboard, and you are done. Full: End-to-end encryption, all the traffic from the browser...
Read more >
Super Simple Cloudflare and Nginx Proxy Manager ... - Reddit
Thanks for making this, I was getting frustrated with SSL certs and this solved that for me. Now it's super easy to setup...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found