Report this

What is the reason for this report?

CNAME for CDN implementation

Posted on July 24, 2013

Hi.

I want to install a CDN and I set up a CNAME for mydomain.com like:

s -> mydomain.netdna-cdn.com.

But, when I try to view, for example, a image from something like http://s.mydomain.com/image.jpg, It redirects me to http://s.myDEFAULT_FIRST_DIGITAL_OCEANdomain.com/image.jpg (with 404 error, obviously).

Any suggestion?

PS: I am using nginx.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

@daniellekwint: I don’t see where Pablo’s answer is incorrect? He’s trying to help.

I added the following in my nginx site config, and problem fixed! But I am not sure if it’s the correct way to solve the problem. <br> <br>server { <br> listen 8080; (NOTE: I’m using varnish) <br> server_name s.mydomain.com; <br> rewrite ^ $scheme://mydomain.netdna-cdn.com$uri; <br>}

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.