Trying to setup virtual hosts on unix PHP on nginx

Posted by user1634653 on Server Fault See other posts from Server Fault or by user1634653
Published on 2012-08-30T12:18:54Z Indexed on 2012/08/31 9:40 UTC
Read the original article Hit count: 187

Filed under:
|
|
|

I have tried to install php5-fpm and Nginx on Ubuntu machine, but I got a problem. When I have only one virtual host on a unix port it is all fine but when I try to add another virtual host Nginx goes to default web page "Welcome to Nginx!" but when I run it on a tcp port example port 9000 it work fine with multisites. It is a fresh install of ubuntu 11.10, Nginx 1.2.3 with php5-fpm installed. It also has extra php installs such as php-apc. I can only give the links to the virtual hosts because I am doing it from a mobile phone. Here are the links for the two virtual hosts I am using: http://ic0nic.co.uk/ic0nic.txt, http://ic0nic.co.uk/sourproxy.txt also I want to use unix port because I find it a whole lot faster.

Edit: Here are the nginx configs

    server {
    server_name ic0nic.co.uk www.ic0nic.co.uk;
    root /var/www/ic0nic.co.uk;
    listen 8080;
    index index.html index.htm index.php;

    include conf.d/drop;

        location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~ \.php$ {
            fastcgi_buffers 8 256k;
            fastcgi_buffer_size 128k;
            fastcgi_intercept_errors on;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass unix:/dev/shm/php-fpm-www.sock;
        root /var/www/ic0nic.co.uk;

        }
}

server {
    server_name sourproxy.co.uk www.sourproxy.co.uk;
    root /var/www/sourproxy.co.uk/;
    listen 8080;
    index index.html index.htm index.php;

    include conf.d/drop;

        location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
        }

        location ~ \.php$ {
            fastcgi_buffers 8 256k;
            fastcgi_buffer_size 128k;
            fastcgi_intercept_errors on;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /var/www/sourproxy.co.uk$fastcgi_script_name;
            fastcgi_pass unix:/dev/shm/php-fpm-www.sock;


        }
}

© Server Fault or respective owner

Related posts about ubuntu

Related posts about nginx