Ok, so I have VPS installed with Debian, NGINX, mysql, php and wordpress. By default the template gives 1 wordpress install in the /var/www/ directory.
However, now I want to add more domains with wordpress to that VPS.
I created a directory called /home/public_html/domain1.com and linked it to the /var/www/ directory.
then I created another directory called /home/public_html/domain2.com and uploaded wordpress there.
What I did next was edit my /etc/nginx/nginx.conf file with the following code:
Code:
user www-data www-data;
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
keepalive_timeout 5;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.php index.html index.htm;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}
}
server {
listen 80;
server_name www.domain1.com;
rewrite ^/(.*) http://domain1.com/$1 permanent;
}
server { listen 80; server_name domain2.com; rewrite ^/(.*) http://www.domain2.com/$1 permanent; }
server {
listen 80;
server_name *.domain1.com domain1.com www.domain2.com *.domain2.com;
location / {
root /home/public_html/$host/;
index index.php index.html;
include /etc/nginx/wordpress_params.regular;
}
# 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 /etc/nginx/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /home/public_html/$host/$fastcgi_script_name;
}
}
}
there are rewrite rules there because I want domain1.com to always display as
http://domain1.com and domain2.com always as
http://www.domain2.com
and the /etc/nginx/wordpress_params.regular contains the following to enable pretty urls in wordpress.
Code:
# WordPress pretty URLs: (as per dominiek.com)
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php?q=$1 last;
# Enable nice permalinks for WordPress: (as per Yawn.it)
error_page 404 = //index.php?q=$uri;
The problem however is that when I go to domain2.com it doesnt work, it display this error message: No input file specified.
domain1.com works fine..
Any idea whats wrong?
Thanks.
PS. im quite a newb so might be missing something simple here:)