Access a Caddy server by IP Access a Caddy server by IP docker docker

Access a Caddy server by IP


According to these tutorials:

https://www.digitalocean.com/community/tutorials/how-to-host-a-website-with-caddy-on-ubuntu-16-04

https://www.booleanworld.com/host-website-caddy-web-server-linux/

https://caddyserver.com/docs/caddyfile-tutorial

your Caddy server should serve the website on your ip using port 80 using one of the follwing configurations:

* {    proxy / django:5000...    ...156.130.11.8 {    proxy / django:5000...    ...:80 {    proxy / django:5000...    ...http:// {    proxy / django:5000...    ...

Maybe http://156.130.11.8 { proxy / django:5000 ... } will do the job. Also try to use localhost instead of the ip address like this:

localhost {    proxy / django:5000...    ...}http://localhost {    proxy / django:5000...    ...}

Good luck!


Is it possible that your Django settings.py only has the mydomain.com as allowed host and not the IP? That way the server should return something like "is not served on this interface" and it shouldn't when the domain name is used.

I experienced a similar problem some time ago, not with Caddy but Apache also on Ubuntu. It would also explain why changing your Caddy config doesn't solve the problem, as it is correct.

settings.py should have a line like

ALLOWED_HOSTS = [IP, 'mydomain.com']

More on this parameter can be found in the documentation.