Closed simbrams closed 1 month ago
Same here. Afaik, Traefik needs two routers, once for HTTP and HTTPS, otherwise can't catch the first request on :80.
can confirm this, although
middlewares:
- redirect-to-https
entryPoints:
- web
- websecure
is added to config. I used Docker build.
I'm working on a PR. Temporary solution is to edit the traefik config with two routers:
routers:
application-abc-router-1:
rule: Host(`example.com`)
service: application-abc-service-1
entryPoints:
- websecure
application-abc-router-2:
rule: >-
Host(`example.com`) &&
PathPrefix(`/`)
service: application-abc-service-1
middlewares:
- redirect-to-https
entryPoints:
- web
I'm working on a PR. Temporary solution is to edit the traefik config with two routers:
routers: application-abc-router-1: rule: Host(`example.com`) service: application-abc-service-1 entryPoints: - websecure application-abc-router-2: rule: >- Host(`example.com`) && PathPrefix(`/`) service: application-abc-service-1 middlewares: - redirect-to-https entryPoints: - web
Nice workaround!
To Reproduce
Hey, when deploying an app using Nixpacks, the https redirect is not workring and displays a
404 page not found
.The HTTPS route is working correctly.
Just when navigating using HTTP ->
404 page not found
.I tried both on a NextJS project and another project with basic html files, both have the issue.
Do you have an idea of the source of this issue ?
Thank you for your work!
Example link working: https://simulateur.twentysixpatrimoine.com/
Example 404 error: http://simulateur.twentysixpatrimoine.com/
Current vs. Expected behavior
Current: http address not redirecting to https and showing 404 page
Expected: should redirect to https
Provide environment information
Which area(s) are affected? (Select all that apply)
Application
Additional context
No response