My config file is located in /etc/nginx/sites-enabled
is called songreccs.conf
and looks like this:
server {
server_name www.songreccs.com songreccs.com;
location /static {
root /home/user/sonreccs/flaskrec/;
}
location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/songreccs.com/fullchain.pem; # manage>
ssl_certificate_key /etc/letsencrypt/live/songreccs.com/privkey.pem; # mana>
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
listen 80;
server_name www.songreccs.com songreccs.com;
if ($host = www.songreccs.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
return 404; # managed by Certbot
}
I thinks that's what the file is doing:
The first block listens on port 443 and should redirect everything to what's specified in the location /
block. The location /static
should give instructions where to find the static files.
The second block listens to port 80 and redirects everything coming in, to port 443. Which is then again taken care of by the first block.
The path of the static files are located at home/user/sonreccs/flaskrec/static
.
The error I'm getting on the website is:
[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (styles.css, line 0)
which didn't occur before using certbot to install the certificate. How can I change it, so it is allowed again?