#2451 closed defect (invalid)

nginx: [emerg] "proxy_pass" directive is not allowed here in /etc/nginx/nginx.conf:31

Reported by: surendar.1209@… Owned by:
Priority: blocker Milestone:
Component: documentation Version: 1.14.x
Keywords: proxy_pass" directive is not allowed Cc:
uname -a: [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
nginx -V: [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

Description

Hi ,

I am following the link to make the load balancer with NGINX
https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/infrastructure-setup/nginx-load-balancer#create-nginx-configuration

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 .

Attachments (1)

nginx.conf (1.1 KB ) - added by surendar.1209@… 15 months ago.

Download all attachments as: .zip

Change History (2)

by surendar.1209@…, 15 months ago

Attachment: nginx.conf added

comment:1 by Maxim Dounin, 15 months ago

Resolution: invalid
Status: newclosed

Your configuration uses proxy_pass rancher_servers_https; at server context in the "http" block:

http {
    server {
        listen 443 ssl;
        proxy_pass rancher_servers_https;

In http, proxy_pass is only allowed at location level, see docs. Hence nginx complains.

Further, note that the configuration also tries to use rancher_servers_https upstream 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.

Note: See TracTickets for help on using tickets.