Opened 4 months ago
Closed 4 months ago
#2451 closed defect (invalid)
nginx: [emerg] "proxy_pass" directive is not allowed here in /etc/nginx/nginx.conf:31
|Reported by:||Owned by:|
|Keywords:||proxy_pass" directive is not allowed||Cc:|
[root@ur108rancher nginx]# uname -a
Linux ur108rancher.mavdallab.com 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@ur108rancher nginx]# nginx -V
nginx version: nginx/1.14.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
I am following the link to make the load balancer with NGINX
this above configuration seems to be tested with 1.14.
but when i use the nginx.conf , it seems that the syntax is not correct .
please help to resolve this .
Change History (2)
by , 4 months ago
comment:1 by , 4 months ago
|Status:||new → closed|
Note: See TracTickets for help on using tickets.
Your configuration uses
proxy_pass rancher_servers_https;at server context in the "http" block:
proxy_passis only allowed at location level, see docs. Hence nginx complains.
Further, note that the configuration also tries to use
rancher_servers_httpsupstream in the "http" block, but an upstream with such name is only defined in the "stream" block. This is not going to work.
Overall, example configuration you are trying to use looks completely broken. You may want to report this authors of the article in question.
If you have further questions on how to configure nginx, please use support options available.