I am running my website with CodeIgniter framework. I have setup cdn using cname cdn.domain.com which is being indexed by Google. And the content of the both domain.com and cdn.domain.com is having same content and is being considered as duplicated resulting ranking issue. I tried contacting the developer and he was not able to help. I hope there is some way to avoid such issue.
Domain and URL duplicates are easy to avoid with using a header method called rel canonical it was invented by the search engines to avoid duplicate content ending up within the indexing and ultimately effecting your rankings.
As DKOATED suggested you can add the CDN to the Webmaster Tools as remove these URLS but this will likely resolve in it being reindexed after you have removed them.
By using rel canonical on your pages you are telling the search engines the MASTER page so say if example you have a page that is labeled Page B and is accisble many ways such as:
domainname.com/?=pageB/ domainname.com/PageB/ domainname.com/catagory/media/pageB/ cdn.domain.com/PageB/
<head> <link rel="canonical" href="http://domainname.com/PageB/" /> </head>
This would tell the search engines that /PageB/ is the master page and no other pages which are accessible on other URLS will be indexed by the search engine. This is by far the best method and was introduced to remove the problem your having. Blogs such as Wordpress have many pages that are accessible by author, tags, and so forth making lots of duplicates as well as Joomla does too and for this reason this tag came along and solved this problem.
If your using a CMS such as Wordpress I recommend Yoast SEO which will do this for and if its Joomla then AceSEF or SH404SEF. If your using something else or a static site then your need to manually put them in or look for something automated to do the process for you.
Once you have the canonical set your best of manually removing the ones from the webmaster tools once you have verified that domain, simply upload the .html verify file to the CDN to do this, Google provide this information how to do.
You can use robots.txt on the CDN but you want images to index so if this is not a direct mirror this could be harmful so only block the htmls/php etc.
if you do not want to indexing by google, you must put : Disallow: / to your cdn directory.
or you can remove google index via google webmaster tools.
but firstly add your cdn domain to google webmaster tools.