有人可以帮我解决这个问题吗? 这是我的代码:
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
这是我得到的错误:
nginx: [emerg] unknown directive "location/" in etc/nginx/sites-enabled/flask_appt:5
nginx: configuration file /etc/nginx/nginx.conf test failed
我尝试查看是否将 / 更改为 \ 甚至删除它,但它没有用,我还进行了 sudo apt update 以查看问题是否是某种更新,我还尝试再次重写代码,但它没用。
应该是
location
和/
之间的空格etc/nginx/sites-enabled/flask_appt
.