“ IP” /static/defaul.css和“ IP” / static显示403禁止的nginx / 1.16.1(Ubuntu),当我运行网站时,页面显示时没有CSS
我正在使用Linode,ufw,Ubuntu
最后一个命令是:
`sudo apt install nginx`
`pip install gunicorn`
`sudo rm /etc/nginx/sites-enabled/default`
`sudo nano /etc/nginx/sites-enabled/Preistracker`
fill in: server {
listen 80;
server_name "IP";
location /static {
alias /home/lukas/Preistracker/main/static;
}
location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
}
`sudo nano ufw allow http/tcp`
`sudo ufw delete allow 5000`
`sudo ufw enable`
`sudo systemctl restart nginx`
sudo ufw状态:
To action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
8000 ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
8000 (v6) ALLOW Anywhere (v6)