I'm setting up a proxy server to intercept and forward all traffic to my Postgres database. I am using NGINX 1.19.2 to accomplish this.
The problem I have is that any queries running more than 10 minute time out. All shorter queries seem to run just fine.
Here is my entire nginx.conf:
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
stream {
server {
# Allow up to 30s to establish a connection with the proxied database
proxy_connect_timeout 30s;
proxy_socket_keepalive on;
listen 5432;
proxy_pass my-server.rds.amazonaws.com:5432;
}
}
I have tried several of the NGINX proxy-related configuration options (eg. proxy_read_timeout), however, those don't work inside of a stream { } context and need to be in an http { } context. For the purpose of connecting to Postgres, I cannot use http.
- Does anyone know what I can do to remove this 10 minute connection timeout with NGINX stream/proxy?
- Does anyone know a better alternative to accomplish what I'm trying to do that uses something other than NGINX?
- I tried
simpleproxyon Ubuntu, but that times out after 2 hours (yes, we have to support some long running queries, eg.VACUUMoperations on billion+ row tables)
- I tried