CSS broken when not using "www" in front of domain name

Hello,

I am setting up a new site, hosting on a VPS w/ nginx. I have my server set up to work with both www before the domain and just the base domain. I am redirecting non-https to https.

I have my baseURL in config.toml set to use https and the www-domain.

The site loads fine when using https://www.example.com, but the CSS is broken when I try to load just https://example.com.

Is my only choice to use my nginx config to redirect the non-www domain to the www-domain?

Thanks
Nick

Is the source for your site available anywhere? It would be much easier for someone to help if you if they had access to the code.

Remove www from your baseURL. Then if you entered the link like https://www.example.com, then it will not broke your css anymore.

my try

  • set baseURL to an empty string
  • set canonifyURLs to false (default)
  • use only relative URLs (starting with /)
  • check all templates for it