Coder Social home page Coder Social logo

Router issue about docker-compose HOT 22 CLOSED

julienhmmt avatar julienhmmt commented on August 26, 2024
Router issue

from docker-compose.

Comments (22)

a10kiloham avatar a10kiloham commented on August 26, 2024 1

looks good so far but i've exceeded my certs now so i have to wait a week to refresh my quota on my main domain. i'll try a secondary domain tonight :)

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024 1

thanks again for your help!

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024 1

awesome thanks! will give it a try this evening.
btw if i want to run mydomain and wwww.mydomain is it easy to tweak this or should i setup a redirect in the TOML?

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024 1

Awesome thanks! Works great. will try the www thing later - I assume that will pull the correct certificate for both domains? or do i need to change for the || in both lines where the host is (and I assume change the wp.conf for domain.com and www.domain.com too?
thanks for this. v useful repo!!

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024 1

Thanks!

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

Hello ! Thanks for your review ;) Seems that "nginx@docker" don't exist... maybe a problem on the docker-compose.yaml. I'm looking for that

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

Problem solved ;) in the docker-compose.yml, I've changed the service name "nginx" to "nginxwp", now it works in my lab.
Can you git clone and try again please?

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

Thanks I'll try in the morning!

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

Hm trying a secondary now - still getting this error on a fresh pull


traefik_1  | time="2020-04-24T14:27:22Z" level=error msg="the service \"nginx@docker\" does not exist" entryPointName=websecure routerName=nginxwp-https@docker

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

i also tried changing this to nginxwp to no avail

      traefik.http.routers.nginxwp-https.service: "nginx"

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

gonna clone the repo on a fresh install Ubuntu 20.04 LTS and try it ;)

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

repo cloned, desactivate SSL (no ssl in my lab to have a fast test) and everything seems working as it.
Can you try to comment the line "traefik.http.routers.nginxwp-https.service: "nginx"" and all other related to SSL and test again please?

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

Works fine with no SSL. Had to delete volumes so had some errors before then but that fixed the non-SSL.

I tried on a fresh server and fresh domain. Works fine non-SSL but SSL still gives a 404.

docker-compose version 1.24.0, build 0aa59064
Docker version 19.03.8, build afacb8b7f0

The only other change is this is on Docker 18 and 19 LTS respectively but can't figure out why.
Is it something to do with the sequence of loading? Is nginx container not loaded when Traefik is trying to run?
Thanks!

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

The fresh domain also fails to get the cert

traefik_1  | time="2020-04-24T17:30:52Z" level=error msg="the service \"nginx@docker\" does not exist" routerName=nginxwp-https@docker entryPointName=websecure
traefik_1  | time="2020-04-24T17:31:05Z" level=error msg="Unable to obtain ACME certificate for domains \"www.mydomain.com\": unable to generate a certificate for the domains [wp.kniaz.org]: acme: Error -> One or more domains had a problem:\n[www.MYDOMAIN.com] acme: error: 400 :: urn:ietf:params:acme:error:tls :: During secondary validation: Fetching https://wp.kniaz.org/.well-known/acme-challenge/Q3XlVmQgu4uaTZlnjuQZnKMleFjxVMZ9mzoD9thqvLs: remote error: tls: internal error, url: \n" providerName=letsencrypt.acme routerName=nginxwp-https@docker rule="Host(`www.MYDOMAIN.Com`)"

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

hmm same here, without SSL this stack is working fine.
do you have configure your domain in the traefik_dynamic.toml ?

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

Ah no what goes in there? Didn’t see anything to change except the email address in either toml file

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

ok, np, no changes on theses files ;)
i'm gonna do some tests with a VPS and tell you what I'll done.

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

problem solved!!! the file "acme.json" is missing........ :( my bad!!
You have to create the file "acme.json" next to docker-compose.yml, and chmod it with "600". After that, restart the stack and it works!

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

git updated !! =)
there's a tweak. ;) The traefik.http router rule with the host needs to be like this :

traefik.http.routers.nginxwp-http.rule: "Host(computerz.solutions) || Host(www.computerz.solutions)"

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

Fantastic! My bad about the missing file...
For the www.domain.com && domain.com, you just have to change it on the docker-compose file, no need in the wp.conf (nginx). Traefik is the reverse proxy, not really nginx. With black magic, traefik will redirect the correct request to the nginx =)
When you'll change the traefik.router line, you will have to <docker-compose up -d> and restart traefik (<docker-compose restart traefikr>)

from docker-compose.

a10kiloham avatar a10kiloham commented on August 26, 2024

Cool, and it will pull certs for both? I keep hitting the rate limits so I'd experiment myself but trying to minimize the hits :) :)
Optimally I'm going to add a redirect so http{s}://domain.com always goes to https://www.domain.com. But without cert I guess https://domain.com would fail.

from docker-compose.

julienhmmt avatar julienhmmt commented on August 26, 2024

yep you'll have the certs for the domains. I understand about the limits... so boring!! =)

from docker-compose.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.