Nginx Configuration for Multi Domain Host will Ruin Your Brain

August 26, 2015 817 views
Nginx Linux Basics LEMP Ubuntu

Are you Use Nginx...
I find a Big Junked Bugs in Nginx web server that it cause brain, Not only your brain but also cause when your visitors didn't find your website and you will lost your thousands of visitors. My suggestion to all beginner, didn't try Nginx as your Web server.
Your brain will death after Confusing you lot.

I become mental, when I'm gone to configure Host Multi Domain with Nginx Web Server.
12-24hours completed but I can not find real solutions What is the main problem my whole website does not work, except a WordPress site. And are also not worked any help from the forum.

the main problem is multisite domain are not working
I 'm installed simple LEMP Nginx on Ubuntu 14.04
Added All domians site block configuration file sites-available to sites-enabled

Only my one Wordpress Site are work fine 
& 2nd wordpress didn't work 
When I visit my site post url nothing find anything except site> page, category-page, & wp admin.
and Other Non WordPress site are only show homepage visiting any site url

This is my sites-available conf file

server {
    listen 80; #default_server
    listen [::]:80; #default_server ipv6only=on

    root /var/www/;
    index index.php index.html index.htm;


    location / {
        try_files $uri $uri/ /index.php?$query_string;

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    sendfile off;
    location = /50x.html {
        root /var/www/;
location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
if (!-e $request_filename) {
 rewrite ^.*$ /index.php last;

location ~ /\.ht {

I am done almost everything to fix problem that Work properly. But nothing happened

By depressed depressing, now I'm planning to Install Apache as Web Server.

Last Chance! to see Any help will Work would appreciated.

2 Answers

As said in my other reply to your question, it isnt nginx that is full of bugs. If you want to use nginx as webserver, you need to have a proper configuration. Nginx is clean, smooth and without any rubbish.

On your problem, I still don't understand halve of your question. You got wordpress working, but also not working? On the wordpress site not working, what doesn't work? Do you get any logs? What options do you have in your wordpress site?

You also need to have different vhost configurations for different websites. Because different website need different options. I can't understand from your question if you got this.

Hello and welcome to Digitalocean

@zafarmd I would recommend you to read this tutorial :

@CrypticDesigns you are right :-)

by Justin Ellingwood
Nginx is an incredibly powerful web server and reverse proxy. In this guide, we'll discuss how to set up server blocks on Ubuntu 14.04 in order to server multiple domains from a single server.
Have another answer? Share your knowledge.