Skip to content

Error "Bad gRPC response. HTTP status code: 500" when set $var in NGINX grpc_pass #2113

Answered by Kotnstantin
Kotnstantin asked this question in Q&A
Discussion options

You must be logged in to vote

After a long review of the materials and tests, the error was discovered.

If we are using variables in the configuration, grpc_pass should have a port on which this grpc can be listened, in this example https and grpcs will use port 443.

So the working configuration for me is:

    server {
        listen 443 http2:
        server _name opc.org.com;
        ssl....;
        location / {
            resolver 127.0.0.11 valid=30s;
            set $https_webui https://dev_webui;
            proxy_pass $https_webui;
        }  
        location /App.Room.Api.Contract.ApiService/UpdateOpcDaTags {
            resolver 127.0.0.11 valid=30s;
            set $grpc_webui grpcs://dev_webui:443;
     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rhansen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant