Setting up a proxy in front of a Consul UI

When setting up consul I bind the http port to local host. So when we want to expose the consul UI we put Nginx on the server and use Nginx to expose the UI. In Consul v1.10 we started seeing issues requiring us to hit the browser refresh at times when switching between services. In Consul v1.11 when you start typing in the search after 1 letter things just hang for minutes before responding. Are there any Nginx requirements for the Consul UI to fix this? When I expose the UI to an external IP it works fine.

This appears to be a timeout issue. I am not sure where to look. Any ideas?

This is what I see in the consul debug log.
2022-02-28T21:05:21.129-0500 [DEBUG] agent.http: Request finished: method=GET url=/v1/internal/ui/services?dc=dc1&index=27575980 from=127.0.0.1:33184 latency=5m2.739515073s

This is what I am seeing in the Nginx Access logs
127.0.0.1 - - consul consul-ui [28/Feb/2022:21:05:21 -0500] “GET /v1/internal/ui/services?dc=dc1&index=27575980 HTTP/1.1” 200 0 “https://consul.io/ui/dc1/services?filter=not” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36” “-” 3898 0 302.741 302.741 127.0.0.1:8505

Hi @tass6773 at the surface level, this sound more like a nginx configuration issue. Can you share with us the nginx configruation that you are using for consul.io please?

cc @johncowen

I think I figured out where the issue is. It looks like the following line in the Nginx config is causing the issue.

add_header Cache-Control “max-age=0, no-cache, no-store, must-revalidate” always;

It seems like once I removed this section every became responsive.

1 Like