Opened 5 years ago
Closed 5 years ago
#1853 closed defect (duplicate)
grpc_pass not parsing set variables
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | nginx-module | Version: | 1.17.x |
Keywords: | set variable grpc_pass | Cc: | |
uname -a: | Linux dfl-tacs-proxy-6d7c6f5d5f-28s85 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 15 17:36:42 UTC 2018 x86_64 Linux | ||
nginx -V: |
nginx version: openresty/1.15.8.2
built by gcc 8.3.0 (Alpine 8.3.0) built with OpenSSL 1.1.1c 28 May 2019 TLS SNI support enabled configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl/include' --add-module=../ngx_devel_kit-0.3.1rc1 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.15 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.7 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl/lib -Wl,-rpath,/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl/lib' --with-pcre --with-compat --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_xslt_module=dynamic --with-ipv6 --with-mail --with-mail_ssl_module --with-md5-asm --with-pcre-jit --with-sha1-asm --with-stream --with-stream_ssl_module --with-threads --with-stream --with-stream_ssl_preread_module |
Description
With proxy_pass when you have a configuration similar to this (example) it works:
server {
listen 8080;
location / {
set $dns "myservice";
proxy_pass http://$dns.svc.cluster.local:80;
}
}
(Let's assume myservice.svc.cluster.local can resolve to a valid address for now)
However, when I do the same with grpc_pass it fails:
server {
listen 8080 http2;
location / {
set $dns "myservice";
grpc_pass grpc://$dns.svc.cluster.local:50051;
}
}
The error I'm getting is:
2019/09/24 06:20:56 [emerg] 1#1: host not found in upstream "$dns.svc.cluster.local" in /etc/nginx/conf.d/grpc.conf:27
nginx: [emerg] host not found in upstream "$dns.svc.cluster.local" in /etc/nginx/conf.d/grpc.conf:27
Is the problem in the ngx_http_grpc_module module or is it not compatible with the ngx_http_rewrite_module module which is where 'set' is defined?
Duplicate of #1542.