I was running a drupal website on Server 01 with IP1 on the domain name example.com with the configuration centos 6 and apache.

As we were having a traffic spike, we wanted a more powerful machine. So we decided to change to ubuntu 13.10 and nginx. Me with my host, built server 2 with IP2 and installed ubuntu 13.10 and nginx. Then we copied the /var/www/html folder of Server 01 to /var/www folder on server 02, created a mysql dump of databases on Server 01, transferred the same to Server 02, and created a same database environment there. Connected drupal to the databases. Tested the work by accessing IP2 on browser. Everything was working fine there except some drupal issues. Decided to proceed with the transfer anyway.

My host then switched IPs. Now we are having Server 01 with IP2 and Server 02 with IP1. The end result was satisfactory. However, a strange behavior was noted.

When any page on the site is loading (after IP switch), it requests for a resource (a png image) on IP2, which is actually on Server 01 at the moment. As my host shut down server 01, the request bring a not found error. As the default coding procedure, all requests on drupal are made relative to the domain name (or the IP). Multiple clearing of caches did not solve the issue.

My question is how did the script even know that such an IP exists? How can I track the part of the script that generates this request?

If my question is missing any information, please comment below and I will add it as edits.

Any help will be greatly appreciated.

Edit:The issue resolved on itself. Don't know what solved it, but when I disabled a CDN, completely re written the configuration page and changed the protocol to https, the issue resolved. Even though the exact cause that created it still remains unknown to me, I am glad that it no longer exists.

  • 1
    You should check your CDN provider settings. Maybe you have specified the origin server with an IP address there, and therefore the CDN requests the files from a wrong server. Or your CDN still has the old DNS entry that points to wrong server cached in its systems. Commented Aug 11, 2014 at 17:17
  • @TeroKilkanen Even though what you mentioned sounds like a possibility, it is highly unlikely that such an outdated DNS entry exist for only one resource on the page. Also, I did not change the IP address - the host changed the IP address of the VMs so that the change is instantaneous. Commented Aug 11, 2014 at 18:26

1 Answer 1


to clarify your question it seems like you have a broken image link after a sever migration on drupal based site? when the link was created you must have visited your server by ip address vs domain name. then drupal created a full link to the image versus creating a relative link. you should update whatever code, module or plugin that is generating the link with a relative link, and if your ip switches again you wont have such issues. an nginx rewite rule can also 302 redirect to correct domain, but its a sloppy fix and better as a backup measure for broken links.

PS now that you are on nginx, using it as a reverse proxy means you can expand to handle tons of traffic.

  • Thanks for the answer. The issue resolved on itself, even though I still don't know what created it in the first place. I have edited my question. What you listed is also a possible cause. PS: I switched over from Apache+Varnish to Nginx standalone and I am already seeing performance improvements. Commented Aug 11, 2014 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.