GRPC API behind nginx not reachable

Hi,

I’ve set up my nginx proxy as described here: NGINX proxy - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server
If i try to connect my application to the API without the nginx proxy, everything is working. If i use the nginx proxy, it hangs on grpc.Dial().

The AS is configured without SSL, the nginx proxy is using SSL.

I’ve tried grpc_pass on location / and listen 443 ssl http2, but that did not work.

Does anyone have an idea?

try adding a cert on the chirpstack side as well. It’ll need to be ssl in both places or not ssl in both places.

1 Like

Thanks for the suggestion bzuelly! I activated TLS on chirpstack and tried my application with direct connection (without the nginx server) and it didn’t work. I found the problem in my app and fixed it!

For anyone in future finding this:
TLS does not need to be enabled on both, only on nginx.
My working conf for nginx is here:

    server_name  	chirpstack.***.**;

    location ~ ^/api/(gateways|devices)/(\w+)/(frames|events)$ {
        proxy_pass http://localhost:8080/api/$1/$2/$3;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_read_timeout 86400s;
        proxy_send_timeout 86400s;
    }

    location / {
        grpc_pass grpc://localhost:8080;
    }


listen 443 http2 ssl;
3 Likes