在这段代码中,可以看到proxy_set_header指令在if语句块内部,而在location块内部。因此,nginx会报错,因为proxy_set_header指令不允许在这里使用。为了解决这个问题,可以将proxy_set_header指令移到location块外部,或者将if语句块移到location块内部。

NGINX报错:nginx emerg proxy_set_header directive is not allowed here in以下是代码:location = if $cookie_safe != proxy_pass http127001; proxy_set_header Host $host; add_header X-Ca

原文地址: https://www.cveoy.top/t/topic/fbE9 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录