Question
Vestacp Nginx proxy passing to a node application
Hello DO Community, I hope all of you are doing great.
I am facing an issue with nginx proxy passing. So far I have successfully install Ubuntu 14.04 and vestacp panel and they are working great. I can even create sub-domains with no problem.
Now I want to create a ghost blog in a sub-domain (eg blog.main-doimain.com) which by the way runs on node. I have managed to run the ghost blog on port 3000 and i can access it using main-domain.com:3000
To access it via sub-domain I have added following server block on nginx (which is installed by vestacp)
server {
listen 80;
server_name blog.main-domain.com;
root /var/www/ghost;
index index.html index.htm;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
but still i can’t access it.
Then I created a blank droplet, installed ubuntu 14.04, installed nginx (only) then installed ghost in it in the same way and added the above server block. And surprisingly it worked, I could access it like blog.main-domain.com!!!
My question is:
- Am I doing something wrong??
- Does vestacp & ghost work along side this way or not??
- Has anyone tried something like this and succeeded or failed??
Thank you and sorry for really long post.
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.
×
On the server with VestaCP, what is the file you are editing with the Nginx configuration? Generally, control panels try to take over most of the system and could potentially overwrite files that you edit manually or load their configuration from non-standard paths.
/etc/nginx/conf.d/ghost.conf
this is the path of my configuration file. from my finding vestacp keeps its configuration setting in this file:
/home/admin/conf/web/nginx.conf;
and that file is included by another one called:
/etc/nginx/conf.d/vesta.conf