By leninhasda
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:
Thank you and sorry for really long post.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
When i do that my mail service stop working, what should i do??
ip i try to redirect x.x.x.x:8069, i want to show like x.x.x.x
when i try to loging to my x.x.x.x/webmail i get 404
I was able to solve my problem. I had to make following changes to do so:
in the server block:
server {
# previously
# listen 80;
# now
# here a.b.c.d is my droplet ip
listen a.b.c.d:80;
server_name blog.main-domain.com;
root /var/www/ghost;
index index.html index.htm;
location / {
# previously
# proxy_pass http://127.0.0.1:3000;
# now
# here a.b.c.d is my droplet ip
proxy_pass http://a.b.c.d:3000;
}
}
and in the ghost blog config file:
server: {
host: 'a.b.c.d', /* here a.b.c.d is my droplet ip */
port: '3000'
}
and lastly i had to change iptable to accept request on port 3000. that it!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.