Hello, I am on an Ubuntu server using Nginx 0.8.54 and trying to set up a few wordpress sites/domains.
Currently I have multiple vhost files symlinked (one for each domain) between sites-enabled and sites available. Each one looks like the one pasted below. However I am only able to see one of the sites in a browser. The rest all just point to first one I made. I am not sure how to make this a multi domain host file while retaining the PHPScript thing underneath. I did not write this vhost file, all I did was add the include file to my wordpress rewrite rules. Please help. Thank you.
server {
listen 80;
server_name MYDOMAIN.com;
rewrite ^/(.*) http://www.MYDOMAIN.com/$1 permanent;
}
server {
listen 80;
server_name www.MYDOMAIN.com;
access_log /home/MYUSER/public_html/MYDOMAIN.com/log/access.log;
error_log /home/MYUSER/public_html/MYDOMAIN.com/log/error.log;
location / {
root /home/MYUSER/public_html/MYDOMAIN.com/public/;
index index.php index.html;
#File included below points to my wordpress rewrite rules
include /home/MYUSER/public_html/nginx/MYDOMAIN/wordpress.conf;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/MYUSER/public_html/MYDOMAIN.com/public/$fastcgi_script_name;
}
}