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

Posted October 12, 2018 2.9k views


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;

    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;


    location ~ /.well-known {
        allow all;

    client_max_body_size 50m;

and changed the config.production.json file to:

 production: {
        url: '',
        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,


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.

Submit an Answer
1 answer

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