By fst0pped
Hi - I followed the below tutorial to the letter, and I’m having trouble getting multiple blogs working correctly:
When I reached the end both domains were pointing at the same instance of Ghost (I’d update the content on the domain1 blog and it would also appear on domain2. I’d try to log in on domain2 and it would throw an error telling me to log in from the URL specified in the config.js file).
I’ve gone through the comments and made a couple of other minor changes based on issues other users have had. I know sometimes the DO image gets updated and renders bits of the tutorial slightly out of date.
There seem to be a few others in the comments on the tutorial having this same issue, but no answers in the thread. Any idea whether something has changed in the image that is causing this? Or have I messed up something during set-up?
Thanks.
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!
Files in sites-enabled are symlinks to sites-available, so these are from my sites-available.
domain1.conf
server { listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name blog.helloimandrew.co.uk; # Replace with your domain
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 10G;
location / {
proxy_pass http://localhost:2368;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
domain2.conf
server { listen 80; # default_server;
listen [::]:80; # default_server ipv6only=on;
server_name stuffandnonsense.me.uk; # Replace with your domain
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 10G;
location / {
proxy_pass http://localhost:2777;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
Really simple solution. server_name in the /etc/nginx/sites-available folder needed to include the ‘www.’ (which it doesn’t in the tutorial).
Without that requests were being directed to the server’s IP address and, because none of them matched any domains in the sites-available folder, were being passed to the default.
Many thanks for your time though! It’s been a learning curve.
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.