Host multiple writefreely blogs on a single instance with custom domains

Host multiple writefreely blogs on a single instance with custom domains
Photo by Naufan Rusyda Faikar / Unsplash
  1. Install writefreely and get up and running with a single blog behind a proxy server e.g. https://original.writefree.ly
  2. Add DNS A records for additional custom domains (can be anything, doesn't have to be a subdomain or anything) e.g. additional.writefree.ly or additional.site.com
  3. Update config (config.ini in the writefreely directory)
    1. single_user -> false
    2. max_blogs -> 0
    3. private -> false
  4. Restart writefreely service: sudo systemctl restart writefreely
  5. Blog menu should now be available. Create extra blogs as required. Should be accessible using the name as a subfolder e.g. https://original.writefree.ly/additional/
  6. Add nginx config as per original site with the new server name as well as 2 additional lines in the proxy section to remove the subdirectory:
location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass http://127.0.0.1:8080/additional/;
    sub_filter '/additional/' '/';
    sub_filter_once off;
    proxy_redirect off;
}
  1. Sym link and restart nginx
  2. Use certbot to add SSL cert for the new domain
  3. Browse to new site at https://additional.writefree.ly