This content is currently unavailable in Dutch. You are viewing the default (English) version.

Nginx is an open-source web server.
To know more, visit the Nginx documentation


To set up a subfolder/subdirectory

Example premise

Important: Replace the example domain with your own document360 provided domain/custom domain.

  • Example domain represented using example.document360.io and the subfolder/subdirectory path (/docs) as example.document360.io/docs
  1. Add the following location blocks in your Nginx configuration file (/etc/nginx/default).
location /docs {
    proxy_pass https://example.document360.io/docs;
    proxy_set_header Host example.document360.io;
    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";
    proxy_ssl_server_name   on;
}
  1. Restart the Nginx web server

For example, If you are using Nginx on Linux, then use the command
$ sudo systemctl restart nginx


To setup on other than '/docs' path

You can also set up your knowledge base on subdirectory paths other than /docs.

For example, /help, /support, etc.

When setting up other paths, add the languages associated with each Workspace.

A few more lines need to be added to achieve this. Restart the server once done.

Example premise

Important: Replace the Document360 provided domain and the subdirectory domain with your own domains.
Also, replace the workspace name, subfolder path, and language with your requirements.

  • Document360 provided domain represented as example.document360.io
  • Workspace name represented as /v1/
  • Subfolder path represented as /help/
  • Language represented as /he for Hebrew.
location /help {
    proxy_pass https://example.document360.io/docs;
    proxy_set_header Host example.document360.io;
    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";
    proxy_ssl_server_name   on;

    sub_filter "v1/docs/" "v1/help/";
    sub_filter "docs/he/" "/help/he";
    sub_filter "/docs/" "/help/";
    sub_filter_once off;
}
  1. Restart the Nginx web server

For example, If you are using Nginx on Linux, then use the command
$ sudo systemctl restart nginx


To enable the Workspaces dropdown

If you want to enable the workspace dropdown navigation for your project when you host in a custom subdirectory and path, add the following codes for each of the workspaces available in your project.

Example premise

Let's assume there are two workspaces available in your project, V1 and V2. In that case, you must add two code blocks, one for each Workspace.

Important: Replace the Document360 provided domain and the subdirectory domain with your own domains.
Also, replace the workspace name, subfolder path, and language with your own requirements.

  • Document360 provided domain represented as example.document360.io
  • Workspace paths represented as /v1/, /v2/
  • Subfolder path represented as /help/
  • Language represented as /he for Hebrew.
location /v2/help {
    proxy_pass https://example.document360.io/v2/docs;
    proxy_set_header Host example.document360.io;
    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";
    proxy_ssl_server_name   on;

    sub_filter "v2/docs/" "v2/help/";
    sub_filter "docs/he/" "/help/he";
    sub_filter "/docs/" "/help/";
    sub_filter_once off;
}
-----------------------------------------------------
location /v1/help {
    proxy_pass https://example.document360.io/v1/docs;
    proxy_set_header Host example.document360.io;
    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";
    proxy_ssl_server_name   on;

    sub_filter "v1/docs/" "v1/help/";
    sub_filter "docs/he/" "/help/he";
    sub_filter "/docs/" "/help/";
    sub_filter_once off;
}
-----------------------------------------------------
location = /v2/docs {
    return 301 /v2/help;
}
-----------------------------------------------------
location = /v1/docs {
    return 301 /v1/help;
}

If you want your readers to navigate between the different public workspaces of your project from the dropdown (on mouse click), add the location block for all available workspaces.

  1. Restart the Nginx web server

For example, If you are using Nginx on Linux, then use the command
$ sudo systemctl restart nginx


Helpful Links:

Here are a few external links that may help you understand the Nginx server location blocks in detail:


Sitemap generation

Example premise

Important: Replace the example domain with your own document360 provided domain/custom domain.


  • Example domain represented using example.document360.io

  • The sitemap prefix remains the same except for the language code (en, fr, de, etc.) example.document360.io/sitemap.xml.en
location /sitemap.xml.en {
proxy_pass https://example.document360.io/sitemap.xml.en;
proxy_set_header Host example.document360.io;
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";
proxy_ssl_server_name   on;


Home page hosted on a subfolder

To host your project's home page on a custom subdirectory/subfolder path, add the following codes for each of the home page workspaces available in your project.

Example premise

Let's assume there are two workspaces and respective home pages available in your project, V1 and V2. In that case, you must add two code blocks, one for each Workspace.

Important: Replace the Document360 provided domain and the subdirectory domain with your own domains.
Also, replace the workspace name, subfolder path, and language with your own requirements.

  • Document360 provided domain represented as example.document360.io
  • workspace paths represented as /v1/, /v2/
location =/v1 {
proxy_pass https://example.document360.io/;
proxy_set_header Host example.document360.io;
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";
proxy_ssl_server_name   on;
}
location =/v2 {
proxy_pass https://example.document360.io/;
proxy_set_header Host example.document360.io;
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";
proxy_ssl_server_name   on;
}
location /v1/en {
  return 301 /v1;
}
location /v2/en {
  return 301 /v2;
}

Exact match

location =/help {

'=' The equal sign can be used if the location needs to match the exact request URI. When this modifier is matched, the search stops right here.
Read more →

  1. Restart the Nginx web server

For example, If you are using Nginx on Linux, then use the command
$ sudo systemctl restart nginx

Knowledge base site home page

For a knowledge base site, the default home page is delivered in the root directory link ( For example, example.document360.io).
If the project contains a Workspace and language-specific home page, the slug following the root directory would be /<workspace_name>/<language_code>. (For example, example.document360.io/v2/he)

Why is my site home page not available?

Make sure you have designed and published the project's home page in the portal's home page builder.


What happens next?

Once you have successfully configured the web server, your knowledge base site is live on your custom subfolder/subdirectory. However, the existing URL for your project will serve the requests.

For example, example.document360.io and example.com/docs (if /docs is your folder path) will point to the knowledge base site.

This may cause duplicate content in search engines (Google, Bing, etc.). A redirect from the Document360 project sub-domain to your custom domain will be required to prevent this.

To enable the redirect from example.document360.io to example.com/docs, please contact us at support@document360.com.