Question
Nginx with Wordpress and a Nodejs app (Mean) in the same VPS (Ubuntu)
Hi,
I’m running a nodejs app in the domain http://test.bideek.com and I want to run a Wordpress with Nginx in http://test.bideek.com/blog
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:
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
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.
http://test.bideek.com load properly the nodejs app
But, http://test.bideek.com/blog 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/
server_name bideek.com;
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;
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×