Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-20-2010, 02:48 PM   #1
LQ Newbie
Registered: Jun 2010
Posts: 2

Rep: Reputation: 0
Question how to config NGINX for multiple domains with wordpress on Debian?

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/ and linked it to the /var/www/ directory.
then I created another directory called /home/public_html/ and uploaded wordpress there.

What I did next was edit my /etc/nginx/nginx.conf file with the following 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;
            rewrite ^/(.*)$1 permanent;

server { listen 80; server_name; rewrite ^/(.*)$1 permanent; }
server {
            listen   80;
            server_name * *;

            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
            location ~ \.php$
            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 to always display as and always as

and the /etc/nginx/wordpress_params.regular contains the following to enable pretty urls in wordpress.

# WordPress pretty URLs: (as per
if (-f $request_filename) {
if (-d $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
# Enable nice permalinks for WordPress: (as per
error_page  404  = //index.php?q=$uri;
The problem however is that when I go to it doesnt work, it display this error message: No input file specified. works fine..

Any idea whats wrong?

PS. im quite a newb so might be missing something simple here:)
Old 06-21-2010, 12:21 PM   #2
LQ Newbie
Registered: Jun 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Seems like the problem was that i need to make a directory called instead of


debian, nginx, wordpress

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 - having trouble setting up multiple domains under debian etch walterbyrd Linux - Software 3 01-08-2010 08:03 PM
Multiple emails accounts(with different from domains) on multiple domains on 1 server locoputo Linux - Server 0 04-12-2009 07:29 PM
Multiple domains in LDAP and 1 samba server for all domains, what to do? xnomad Linux - Server 1 11-14-2008 10:12 AM
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 11:22 PM
Installing Wordpress into multiple directories oadvantage General 2 04-28-2006 05:34 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration