Score:0

Nginx keeps trying to serve a file?

cn flag

This is my nginx.conf

events {
}
http {
    server {
        listen 80;

        rewrite_log on;

        if ($http_x_forwarded_proto = "http") {
            return 302 https://$host$request_uri;
        }

        location /.health {
            return 200 'OK';
        }

        location /.status {
            stub_status;
            server_tokens on;
        }

        location ~ ^\/([^.][^\/]*)(.*)$ {
            proxy_pass http://$1.$DISCOVER$2$is_args$args;
        }
    }
}

How can this config, which clearly returns a static response for /.health and has no other routes, possibly be having this error? At no point was nginx directed to look for a file.

[error] 16#16: *2 open() "/usr/share/nginx/html/_health" failed (2: No such file or directory), client: 10.0.1.21, server: localhost, request: "GET /_health HTTP/1.1", host: "10.0.0.241"
in flag
The request shows "/_health", not "/.health".
cn flag
Ya copy/paste error when making this post. I was originally using /.health and thought it might be doing weird things around assuming file extensions... After struggling with this for several hours, I think I was just not putting the nginx.conf in the right place. Deploying now...
Score:0
cn flag

Looks like I had a regression around properly placing the nginx.conf file. I was too focused on routing logic to notice, but the main evidence is that there was an nginx welcome page from the default nginx.conf.

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.