Nginx with Wordpress and a Nodejs app (Mean) in the same VPS (Ubuntu)

August 13, 2016 269 views
Nginx Node.js Ubuntu


I'm running a nodejs app in the domain and I want to run a Wordpress with Nginx in

I started with a "one click install" using the Mean application and installing the nodejs app in the port 9000
Then, I'm following this link to install Nginx and Wordpress:

I guess, in the Nginx file config, I should create one location for /blog (linked to Nginx+Wordpress in port 80) and another one for "/" (linked to the node app in port 9000), but doesn't work. load properly the nodejs app
But, is not loading wordpress.

Am I doing something wrong ?

server {

listen 80 default_server;

listen [::]:80 default_server ipv6only=on;

root /var/www//html;

index index.php index.html index.htm;

# Make site accessible from http://localhost/


location /blog {

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


error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
                root /usr/share/nginx/html;

location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;

location /{

        proxy_pass http://localhost:{9000};

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection 'upgrade';

        proxy_set_header Host $host;

        proxy_cache_bypass $http_upgrade;



Be the first one to answer this question.