Getting a 401 Authorization Required message on my 'www' subdomain. Help!

cname

#1

I’m new here, and I may be doing things wrong…but I set up a CNAME record on my domain in order for www.mydomain(.)com to load like mydomain(.)com would.

The CNAME record has the following settings:

Name: www
Value: @
TTL: Automatic
Status: Orange

But what I get when I load www.mydomain.com is this:
image

Any ideas on what I should do to get the www subdomain working? The domain with www is working just fine.

I really appreciate the help!

P.S. Excuse the ()s - I can only add 2 links as a new user.


#2

I meant that the domain without the www is working just fine.


#3

This is an issue with your origin server likely being misconfigured. 4xx errors are only served from the origin, Cloudflare will only send 5xx error codes.


#4

That appears to be an error from the origin server. It’s likely you haven’t mapped the www virtual directory correctly to

curl -Ik --resolve www.your.site.com:80:your.origin.ip.address http://www.your.site.com/
HTTP/1.1 401 Unauthorized
Server: nginx/1.11.9
Date: Thu, 16 Aug 2018 01:22:08 GMT
Content-Type: text/html
Content-Length: 195
Connection: keep-alive

You could use a page rule to redirect www.yoursite.com to yoursite.com or edit your nginx server block config and add the www server.


#5

Got it. We use CodePen so I will see if I can figure out how to use a page rule in order to do a redirect. Thanks all!


#6

@cscharff The Page Rule worked beautifully. Thank you again!


#7

This topic was automatically closed after 31 days. New replies are no longer allowed.