domain with www does not work for Caddy server


(Tony Wang) #1

I’m using Caddy as a reverse proxy server that points to a docker container that runs web service at port 8181. The domain abc.com works, but www.abc.com does not work. I wonder where might be wrong:

Caddyfile:

abc.com {
    proxy / localhost:8181
}

I have an A record for www.abc.com that points to the IP address of the server.


(Matthew Fay) #2

Hi @rcholic,

The sites abc.com and www.abc.com both appear to be working from my end, both served by Apache, both appear to redirect to https://abc.go.com/.

Do you still need help with these sites?


(Tony Wang) #3

actually, I was using abc.com as an example domain, I don’t own it.

My real domain name is streamusb.com, but www.streamusb.com does not work

thanks


(Lucas) #4

By the looks of your Caddyfile example I’m going to guess that you haven’t added the www.streamusb.com domain to your configuration.

So:

streamusb.com,
www.streamusb.com {
    proxy / localhost:8181
}

Or if you only wanted www:

www.streamusb.com {
    proxy / localhost:8181
}

streamusb.com {
    redir https://www.streamusb.com{uri}
}