Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant reach my App by assigned Domain #1190

Closed
Viktor-as opened this issue Jan 23, 2025 · 5 comments · Fixed by #1216
Closed

Cant reach my App by assigned Domain #1190

Viktor-as opened this issue Jan 23, 2025 · 5 comments · Fixed by #1216
Labels
bug Something isn't working

Comments

@Viktor-as
Copy link

Viktor-as commented Jan 23, 2025

To Reproduce

I deployed my app as Compose service.
I added custom subdomain.domain.com to reach my app - but it dosnt work. When I open the url I see only 404 page not found
Tried another domain, one managed on Cloudflare, another on Hostinger - both dont work.
I opened in firewall port 3005 and I can reach my app with URL myip:3005 - so the app is working
I configured to reach the dashboard on server.mydomain.com - its working fine
If I press "Preview Compose" - I see that dokploy-network and labels are automatically added. But I still cant reach the app through domain...
Tried to redeploy multiple times

my compose file looks like this:

services:
backend:
container_name: back-v1
build:
context: .
args:
NODE_ENV: ${NODE_ENV}
PORT: ${PORT}
ports:
- '3005:3005'
env_file:
- .env
volumes:
- ./media:/home/node/app/dist/media
networks:
- back_network
- mongo_network
- dokploy-network
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.backas-8db9ud-2-web.rule=Host(subdomain.domain.com)
- traefik.http.routers.backas-8db9ud-2-web.entrypoints=web
- traefik.http.services.backas-8db9ud-2-web.loadbalancer.server.port=3005
- traefik.http.routers.backas-8db9ud-2-web.service=backas-8db9ud-2-web
- traefik.http.routers.backas-8db9ud-2-web.middlewares=redirect-to-https@file
- traefik.http.routers.backas-8db9ud-2-websecure.rule=Host(subdomain.domain.com)
- traefik.http.routers.backas-8db9ud-2-websecure.entrypoints=websecure
- traefik.http.services.backas-8db9ud-2-websecure.loadbalancer.server.port=3005
- traefik.http.routers.backas-8db9ud-2-websecure.service=backas-8db9ud-2-websecure
- traefik.http.routers.backas-8db9ud-2-websecure.tls.certresolver=letsencrypt
- traefik.http.routers.backas-8db9ud-3-web.rule=Host(subdomain.domain2.com)
- traefik.http.routers.backas-8db9ud-3-web.entrypoints=web
- traefik.http.services.backas-8db9ud-3-web.loadbalancer.server.port=3005
- traefik.http.routers.backas-8db9ud-3-web.service=backas-8db9ud-3-web
- traefik.http.routers.backas-8db9ud-3-web.middlewares=redirect-to-https@file
- traefik.http.routers.backas-8db9ud-3-websecure.rule=Host(subdomain.domain2.com)
- traefik.http.routers.backas-8db9ud-3-websecure.entrypoints=websecure
- traefik.http.services.backas-8db9ud-3-websecure.loadbalancer.server.port=3005
- traefik.http.routers.backas-8db9ud-3-websecure.service=backas-8db9ud-3-websecure
- traefik.http.routers.backas-8db9ud-3-websecure.tls.certresolver=letsencrypt
networks:
back_network:
name: back_network
external: false
mongo_network:
external: true
dokploy-network:
external: true

Current vs. Expected behavior

I expect to reach my app by the domain that I provided, but I cant.
I can only reach by myip:3005 over http

Provide environment information

Ubuntu 24.04
Dokploy v0.17.8
VPS provider Hostinger
Application: Payload CMS

Which area(s) are affected? (Select all that apply)

Docker Compose, Traefik

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

No

@Viktor-as Viktor-as added the bug Something isn't working label Jan 23, 2025
@htmlviktor
Copy link

htmlviktor commented Jan 24, 2025

Oh yeah! I have exactly the same situation. Hosting on hostinger and domain on CF and on hostinger.

I can't get it to work, the application is simply not available on the domain.

Maybe the problem is in the hosting itself?

@Viktor-as
Copy link
Author

Viktor-as commented Jan 24, 2025

Finally solved it :D

As written here

You have to declare ports in compose file like this:
ports:
- 3005

Also before that in Cloudflare I changed SSL mode from Full to Full (Strict) as told here - after this step the domain did not start to work yet, but maybe also contributed to the final solution

Now both of my domains work and open the app 😎

@Viktor-as
Copy link
Author

ok... I deployed another app with Dokploy and the domains from cloudflare just stopped working...
Domains from Hostinger still work
what else do I have to do, to make the domains from cloudflare to work??

@Viktor-as Viktor-as reopened this Jan 25, 2025
@Viktor-as
Copy link
Author

found a new solution, hope this time it will continue to work instead of randomly working, then not working, then working again....

#821 (comment)
After you make these config changes dont forget to restart the server (in UI go to Server Settings > Server > Reload )
For now it looks like its working fine, hope it will not stop again randomly.

I am grateful for this tool but it should take less then 3 days to setup it and debug... trying different solutions, different domains, different servers... I am lucky I found this issue and solution after checking all the open issues started to dig into closed ones.
And this issue should not be closed, its not fixed. You can fix it yourself but there is not a single word about this problem in documentation.

@Siumauricio
Copy link
Contributor

Siumauricio commented Jan 26, 2025

I will add the missing line to traefik.yml for new installations, for existing installations you will need to add manually, thanks for pointing out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants