Score:0

nginx change timeout response

pl flag
DJ'

We have a reverse proxy server with nginx. We want to pass a static page in case the reverse proxy timesout.

Current configuration is:

server {

    listen 443;
        ssl on;
        ssl_certificate /etc/ssl/****.crt;
        ssl_certificate_key /etc/ssl/****.key;
        ssl_protocols TLSv1.2 TLSv1.3;

        server_name ****;

        access_log            /var/log/nginx/****.log;
        error_log             /var/log/nginx/****.log;
        location / {

                proxy_set_header        Host $host;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Forwarded-Proto $scheme;

                proxy_read_timeout  30;

                proxy_ssl_name $host;
                proxy_ssl_server_name on;
                proxy_pass https://****;
        }

        location /Callback/reservebalance {
                proxy_pass https://****;
                proxy_read_timeout 2;
                proxy_connect_timeout 2;
                proxy_send_timeout 2;
                return this response if server times out on proxy{
                    default_type application/json;
                    return 200 '{"response":"my static response"}\n';
                }
        }
}
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.