# How to setup ghost with nginx configuration?

**URL:** <https://forum.ghost.org/t/how-to-setup-ghost-with-nginx-configuration/34219>\
**Category:** Self-hosting\
**Created:** [November 16, 2022, 7:52pm UTC](https://forum.ghost.org/t/how-to-setup-ghost-with-nginx-configuration/34219 "2022-11-16T19:52:38Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![aditodkar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/aditodkar/32/16089_2.png) [@aditodkar](https://forum.ghost.org/u/aditodkar)\
**Post date:** [November 21, 2022, 9:09am UTC](https://forum.ghost.org/t/how-to-setup-ghost-with-nginx-configuration/34219/7 "2022-11-21T09:09:37Z")

</div>

This solution worked for me:

```auto
location ^~ /blog {

                client_max_body_size 10G; # Required for uploading large files

                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_pass http://127.0.0.1:2368;
        }

```

Note in config.production.json file:  
replace `"url":"http://localhost:2368/"` with

```auto
"url": "https://yourapp.com/blog",

```

Some reference links:

1. [How install Ghost in a subfolder](https://ghostboard.io/blog/how-install-ghost-in-subfolder/)

2. [How to install Ghost in a subdirectory with Nginx? (Getting 404) - Stack Overflow](https://stackoverflow.com/a/64601536/8103891)

---

_[View the full topic](https://forum.ghost.org/t/how-to-setup-ghost-with-nginx-configuration/34219)._
