Putting your Swish Blog on a Subdirectory

Using a subdirectory (also called subfolder) for your blog can be good for SEO. So naturally, this is something that Swish supports, although it requires some advanced configuration.

We are using /blog as the subdirectory in this documentation, but you can choose anything else.

Perform the following steps:

  1. Add a custom domain.

  2. Add the directory as part of the custom domain, for example, in the the custom domain field, enter example.com/blog. Adding a Custom Domain

  3. Set up a reverse proxy to forward all request from the /blog subdirectory to http://cn.swish.ink. Remember to set the appropriate Host Header. Here is an example nginx configuration:

    server {
        listen 80;
        listen [::]:80;
        server_name example.com www.example.com;
        location /blog/ {
            proxy_pass http://cn.swish.ink;
            proxy_set_header Host $http_host;
            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;

See Also


Check out the Demo to see how everything works without having to sign up.