> For the complete documentation index, see [llms.txt](https://docs.themeupstudio.com/crimson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.themeupstudio.com/crimson/multilingual/nginx-setup-subfolder-routing.md).

# NGINX Setup (Subfolder Routing)

{% hint style="warning" %}
This page applies only to the subfolder strategy. If you are using locale-specific domains/subdomains, point each domain to its own Ghost install instead, and configure Crimson's locale-domain variables in [Code Injection](/crimson/getting-started/code-injection.md).
{% endhint %}

Once you have multiple Ghost installs, your server needs to route:

* `/` → English Ghost
* `/hi/` → Hindi Ghost
* `/es/` → Spanish Ghost

Crimson uses NGINX “location blocks” so that each path proxies to the correct Ghost instance/port.

#### Where you edit

Crimson notes you’ll see files in:

`/etc/nginx/sites-available/`

And that you typically edit the SSL config file:

* `www.example.com-ssl.conf`

#### Understand the default location block

The default NGINX block routes your root path `/` to your English Ghost instance using `proxy_pass` to a local port. Crimson explains that the port can vary by setup and suggests using `ghost ls` to see which ports are being used.

#### Add one location block per additional language

Crimson’s approach:

* Add a `/hi/` block (Hindi) with a different port
* Add a `/es/` block (Spanish) with a different port

**Example:**

```nginx
location /hi/ {
    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:2372;
    add_header X-Content-Type-Options $header_content_type_options;
}

location /es/ {
    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:2373;
    add_header X-Content-Type-Options $header_content_type_options;
}
```

#### The only two things that change per language block

Crimson highlights two differences:

1. The URL path (`/hi/`, `/es/`)
2. The `proxy_pass` port (different Ghost instance per language)

#### Restart NGINX

After updating the config, restart NGINX so it re-reads the changes (Crimson gives `systemctl restart nginx` as an example).

#### Ongoing maintenance (important)

Once set up, each language site is maintained like a normal Ghost install—just repeated per language directory/instance.
