How can I add custom routes to traefik? #563
Replies: 13 comments
-
@WinstonN The info here should be of help on this front: https://docs.warden.dev/configuration/multipledomains.html |
Beta Was this translation helpful? Give feedback.
-
@davidalger I have used that document, and have a setup like this currently .warden/warden-env.yml version: "3.5"
services:
nginx:
labels:
- traefik.http.routers.${WARDEN_ENV_NAME}-nginx.rule=
HostRegexp(`{subdomain:.+}.${TRAEFIK_DOMAIN}`)
|| Host(`${TRAEFIK_DOMAIN}`)
|| HostRegexp(`{subdomain:.+}.localhost`)
|| Host(`localhost`)
|| HostRegexp(`{subdomain:.+}.localhost.test`)
|| Host(`localhost.test`)
|| HostRegexp(`testsubdomain.loca.lt`)
|| Host(`testsubdomain.loca.lt`)
|| HostRegexp(`127.0.0.1`)
|| Host(`127.0.0.1`)
php-fpm:
extra_hosts:
- localhost:${TRAEFIK_ADDRESS:-0.0.0.0}
- localhost.test:${TRAEFIK_ADDRESS:-0.0.0.0}
- testsubdomain.loca.lt:${TRAEFIK_ADDRESS:-0.0.0.0}
- 127.0.0.1:${TRAEFIK_ADDRESS:-0.0.0.0}
php-debug:
extra_hosts:
- localhost:${TRAEFIK_ADDRESS:-0.0.0.0}
- localhost.test:${TRAEFIK_ADDRESS:-0.0.0.0}
- testsubdomain.loca.lt:${TRAEFIK_ADDRESS:-0.0.0.0}
- 127.0.0.1:${TRAEFIK_ADDRESS:-0.0.0.0} When I open up
My development site loads correctly The problem I have is, using NGROK, or something like localtunnel, I always get a 404 - see image How can I log that 404 page? It seems like it's a traefik/nginx page |
Beta Was this translation helpful? Give feedback.
-
That's a generic 404 response from Traefik when the request doesn't match any of the configured routers (i.e. set of labels). You'll want to verify the host header Ngrok and/or Lt is passing on matches one of the routers the shows up in the dashboard: https://traefik.warden.test/dashboard/#/http/routers (and if one of your routes doesn't show up, try re-creating the container |
Beta Was this translation helpful? Give feedback.
-
I had some time to look into this, I logged out the request headers (using a simple node server)
I can see the host header is what it should be It's curious because the tunnel does reach my other node, django, apps @davidalger you wouldn't happen to know of a way to set the default traefik page (that shows the 404) to forward to |
Beta Was this translation helpful? Give feedback.
-
The only observation I can offer is is the rules provided don't appear to cover |
Beta Was this translation helpful? Give feedback.
-
@WinstonN , if you have any more findings regarding this issue, it would be great if you could share them. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure how to do this in warden, in theory it should work, but I haven't been able to get it working. Closing this issue |
Beta Was this translation helpful? Give feedback.
-
Create a run_ngrok.sh script with the content from following the url: https://gist.github.com/sjb9774/7dd44d37c0001fd88ce4e1e819e2025b Make sure you've updated the last line with name of project from .env file. After that, run that script on your local. |
Beta Was this translation helpful? Give feedback.
-
Have someone had any success with warden + ngrok? |
Beta Was this translation helpful? Give feedback.
-
Have someone had any success with warden + ngrok? |
Beta Was this translation helpful? Give feedback.
-
Alguien pudo solucionar este tema ? si es así podrían compartir la solución ? |
Beta Was this translation helpful? Give feedback.
-
any solution :) |
Beta Was this translation helpful? Give feedback.
-
This is what worked for me:
And update core_config_data (base urls, to be the ones ngrok gives you). To allow xdebug, I had to force all requests to php-debug container.
client host is your IP. Get it by inspecting nginx container: docker inspect , and check NetworkSettings.Networks..Gateway
|
Beta Was this translation helpful? Give feedback.
-
When I use NGROK, or localtunnel, to create a tunnel between my docker environment, and the internet, I always get a 404 page
This page seems to belong to traefik
I get the same page when I hit https://localhost:443
I want to ensure that when I use a service like localtunnel, and I set the local-host to the same as my local site, that I reach it and not a 404
an example command below
Beta Was this translation helpful? Give feedback.
All reactions