nginx:[emerg] unknown directive“location/”

epggiuax  于 2023-03-29  发布在  Nginx
关注(0)|答案(1)|浏览(198)

有人能帮我解决这个问题吗?下面是我的代码:

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更新,看看问题是某种更新,我也试图重写代码再次,但它不工作。

44u64gxh

44u64gxh1#

应该是etc/nginx/sites-enabled/flask_apptlocation/之间的空格。

相关问题