Question

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

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,

Subscribe
Share

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.

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.

Yup i can confirm this as i’ve just finished with my set’up. :D

solved in seconds, thank you so much :)


Submit an 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