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

Problem when use .com instead of .localhost #102

Closed
Ichtuus opened this issue Jan 6, 2021 · 5 comments
Closed

Problem when use .com instead of .localhost #102

Ichtuus opened this issue Jan 6, 2021 · 5 comments

Comments

@Ichtuus
Copy link

Ichtuus commented Jan 6, 2021

When is use this following command

SERVER_NAME="monsite.com, caddy:80" docker-compose up --build

Application not display on "monsite.com", its make an SSL error => SSL_ERROR_INTERNAL_ERROR_ALERT
but when i use this

SERVER_NAME="monsite.localhost, caddy:80" docker-compose up --build

The application be display on "monsite.localhost"
I think its obvious issu, but I can't solve the problem

Someone else can help me ?

@dunglas
Copy link
Owner

dunglas commented Jan 6, 2021

Is your server publicly exposed on the internet? It's mandatory for Caddy to generate the TLS certificate using Let's Encrypt.

@Ichtuus
Copy link
Author

Ichtuus commented Jan 6, 2021

No i just work locally to upgrade my skills, i search to use another host to my actual caddy server
To use "monsite.com" instead of "monsite.localhost"

I can make that with nginx or apache, but i can't do it with caddy

Actually caddy give this followings url => https://monsite.localhost/

@Ichtuus
Copy link
Author

Ichtuus commented Jan 6, 2021

Ok i solve my problem with this followings instruction

I change my SERVER_NAME env var in my .env.local file to monsite.com into http://monsite.com, to "disabling" ssl and its work !

I find auto_https disable_redirects but its available only from v2.1 of caddy

Thanks for your help, i close this issue

@dunglas
Copy link
Owner

dunglas commented Jan 7, 2021

Alternatively, you can use a self-signed TLS certificate: https://caddyserver.com/docs/caddyfile/directives/tls

To generate a valid certificate for a real domain, Caddy must be exposed publicly on the internet.

@dunglas dunglas closed this as completed Jan 7, 2021
@rccc
Copy link

rccc commented Jan 9, 2024

To generate a valid certificate for a real domain, Caddy must be exposed publicly on the internet.

Hello, does this means that starting the container on a produciton server will not be enough ? What do you mean by " exposed publicly " ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants