Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Whilst trying to fix a different issue, and clean up my config files, I've caused a problem. I have 2 domains binded to a site, but now, whenever I visit domain1, it downloads the php file as 'download', rather than executing it in PHP-FPM. If I browse to domain2 however, the file gets executed.

The weird thing is, they are both defined in the same config file. I must have changed something as it was previously working, but recently stopped. My config file for the sites look like this, (they are included from within the default nginx.conf file):

server {
    listen 80;
    server_name site1.domain.co.uk site2.domain.co.uk;

    root /var/www/php/hobnobs;

    # access_log /var/log/nginx/site-access.log;
    # error_log /var/log/nginx/site-error.log;

    location / {
        index index.html index.php;
        try_files $uri $uri/ /index.php;
    }

    location ~ \.php$ {
        try_files $uri /index.php;
        fastcgi_pass        php;
        include             fastcgi_params;
        fastcgi_param       PATH_INFO $fastcgi_script_name;
        fastcgi_param       SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location  /common {
        alias  /var/www/common;
    }
}
share|improve this question

2 Answers 2

It's possible that when you visit the site1 you go, for some reason) on the default Virtual host instead of the one you have posted ?

Have you verified that when you go to site1 the access log of that VH register a new entry ?

Best regards

share|improve this answer
    
Urgh I don't believe it. Went to check something, and it started working again. Literally didn't alter a thing. No idea what happened. Thanks though –  SteveEdson Dec 20 '12 at 15:47
up vote 0 down vote accepted

I can only presume that something was cached, I restarted and rebooted everything and after a while, it started working again. I didn't make any more changes to any config files, it just started working again.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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