Report this

What is the reason for this report?

Moving a 1-click ghost installation to a subdirectory getting 404 error.

Posted on October 12, 2018

Hello,

I am trying to run a ghost blog in a subdirectory(/blog) instead of the direct domain link. I have changed the location from /etc/nginx/sites-available/site_name.conf

server {
   listen 80;
   listen [::]:80;

   server_name domain.com;
   root /var/www/ghost/system/nginx-root;

   location ^~ /blog {
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header Host $http_host;
       proxy_pass http://127.0.0.1:2368;

   }

   location ~ /.well-known {
       allow all;
   }

   client_max_body_size 50m;
}


and changed the config.production.json file to:

 production: {
        url: 'http://example.com/blog/',
        mail: {},
        database: {
...

and then I restarted the server

sudo service nginx restart

it has been moved to /blog but it doesn’t show me the posts, images, footer, admin page /ghost link etc., perhaps it’s about MySql but I couldn’t find a way to solve it, may someone direct me how can I solve it?

Thank you,



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!

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.

This question was answered by @X40C:

Try removing the / at the end of the url in ghost’s config file. You can then cd to the gost dir and issue ghost restart. If this doesn’t help i’ll spin’up a ghost instance and see if i can figure it out.

View the original comment

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.