0

After I ran certbot --nginx browsers cannot access css of my website.

style.css is located in ./styles of root of my site. The error is Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID style.css:1

Edited: string from my .html files (where example.com is my site domain):

<link rel="stylesheet" type="text/css" href="https://www.example.com/styles/style.css">

Edited: my tree -p output:

.
├── [drwxr-xr-x]  about
│   ├── [-rw-r--r--]  index.html
│   └── [-rw-r--r--]  index.md
├── [-rw-r--r--]  icon.ico
├── [-rw-r--r--]  index.html
├── [-rw-r--r--]  index.md
├── [drwxr-xr-x]  styles
│   ├── [-rw-r--r--]  prev.css
│   └── [-rw-r--r--]  style.css
└── [drwxr-xr-x]  templates
    └── [-rw-r--r--]  temp.html

Edited: new error ocured:

example.com/:5 GET https://www.example.com/styles/style.css net::ERR_CERT_COMMON_NAME_INVALID

What should I do to solve the issue?

  • Could you show the first line of `style.css`, please? I think there is a wrong `@import` or something. – digijay Dec 07 '21 at 11:52
  • Hi! No, I didn't use ```@import``` in my ```style.css```. It used to work until recently. – Laughing Laugh wwwwwww Dec 07 '21 at 14:45
  • Please add the output of `nginx -T` to the question so we can see your full nginx configuration. Most likely Certbot has made bad changes to the configuration. – Tero Kilkanen Dec 07 '21 at 15:13
  • does the cert include www and domaun only, it is telling strictly that something is wrong on the line one, please show us eother the real domain name or the content of the file – djdomi Dec 07 '21 at 15:14

1 Answers1

0

I solved this issue putting www.example.com into my server_name except example.com. Thank you everyone for your answers.