I don’t have much experience with Nginx so I’m just trying to figure this out, please bare with me.
I setup a droplet with Ghost and setup up under http://domain.com/blog, however I want to setup a static page under http://domain.com/ which is going just be a simple html site. I’m not too sure how to go about doing this. I’ve done some research and some googling and can’t get it to work.
Any advice and tips would be really helpful, 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!
Heya,
To set up a static page at the root domain while having Ghost running under /blog, you’ll need to modify the Nginx configuration.
Follow these steps:
/var/www/html./etc/nginx/sites-available/your_domain.- server {
- ...
- location / {
- root /var/www/html;
- try_files $uri $uri/ =404;
- }
- ...
- }
Make sure to replace /var/www/html with the path to your static files directory. Save the changes and exit.
Finally, restart Nginx to apply the changes:
- sudo systemctl restart nginx
Your static page should now be accessible at the root domain, while the Ghost blog will remain under /blog.
For more information on Nginx configurations, you can refer to the DigitalOcean Nginx Server Blocks tutorial.
Hope that this helps!
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.