---
title: Hosting Spaces on a sub folder
slug: archbee-docs/hosting-spaces-on-a-sub-folder
description: Learn how to host your documentation on a custom domain and make it available on the main domain using Archbee. Set up a default custom domain, proxy requests, and utilize the custom 'canonical' tag to avoid duplicate content issues with Google. This docu
docTags: 
createdAt: 2022-08-24T04:49:06.000Z
---

The default way to host documentation with Archbee is on your custom domain, e.g **docs.piedpiper.com**. To make docs available at your main domain at a sub folder like [https://www.piedpiper.com/docs](https://www.piedpiper.com/docs), you will need access to your webservers to be able to proxy requests to our systems.&#x20;

You will need to setup a default custom domain anyway, and then proxy to it from your main domain. We will take care that Google doesn't see it as duplicate by signalling it through a custom `canonical` tag.

## Step 1: Enter the optional proxy like in the picture below

![](https://app.archbee.com/api/optimize/bNBm7nPJgXjbjLyfbHNh2/3N80unCzlKaAcM2cSKh1m_hosted-sub-light.png)

:::hint{type="warning"}
While you're here, please make sure the URL path at **Step 5,** is the same one you set below in your webserver config.
:::

## Step 2: Here are a couple of samples from popular webservers on how to config it so that the proxying system works

### Nginx Server Config

```none
location /docs {
    proxy_ssl_server_name on;
    proxy_pass https://docs.piedpiper.com/docs
    proxy_set_header Host docs.piedpiper.com;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header "requested-by" "proxy";
}
```

### Apache Server Config

::::WorkflowBlock
:::WorkflowBlockItem
Ensure the following modules are installed and enabled:

```none
sudo a2enmod proxy
sudo a2enmod proxy_balancer
sudo a2enmod proxy_http
```
:::

:::WorkflowBlockItem
Add the following to the site configuration file under `/etc/apache2/sites-available`

For example:  `000-default.conf`

```javascript
SSLProxyEngine on
ProxyPass "/docs" "https://docs.piedpiper.com/docs"
ProxyPassReverse "/docs"  "https://docs.piedpiper.com/docs"
```

Our full domain test working config looks something like:

```none
<VirtualHost *:80>
   ServerName piedpiper.com
   DocumentRoot "/app"
   <Directory "/app">
       Options Indexes FollowSymLinks
       AllowOverride All
       Require all granted
   </Directory>

   SSLProxyEngine on
   ProxyPass "/docs"  "https://docs.piedpiper.com/docs
   ProxyPassReverse "/docs"  "https://docs.piedpiper.com/docs"
</VirtualHost>
```
:::

:::WorkflowBlockItem
Restart the Apache server:

For example, If you are using Apache on Linux:&#x20;

```none
$ sudo service apache2 restart
```
:::
::::

