cross-posted from: https://lemmyfly.org/post/2382

thanks to @[email protected] for noticing www.lemmyfly.org was not secured and not pointing to the lemmy instance.

Checking the lemmy ansible files I saw your nginx configuration file is located in /etc/nginx/sites-available/[sitename].conf

To add a redirect for your www.[sitename, add: (lemmyfly.org example)

server {
  server_name www.lemmyfly.org;
  return 301 $scheme://lemmyfly.org$request_uri;
}

check your config with sudo nginx -t

restart nginx: sudo systemctl restart nginx

  • Admiral Patrick@dubvee.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    You’re nicer than I am. If someone’s still typing “www” into the URL bar, I make certain assumptions about them with my site’s Nginx config:

    server {
      server_name www.dubvee.org;
      return 301 https://aarp.org;
    }