IMO your configuration looks like an include maze/mess, so I won’t dig
to
far in it.
From what I saw you define at least 2 servers listening on port 80 with
nothing to differentiate them from each other (such as a server_name).
I thought that kind of configuration was rejected by nginx, if my memory
does not fail me.
I would:
1°) Check your configuration is accepted by nginx and effectively
applied
(testing it before reload + on reload, check the error log)
2°) 1 request is served by 1 location only. Ensure you are up to speed
with
location modifier precedence (see location http://nginx.org/en/docs/http/ngx_http_core_module.html#location
documentation) and that your request is effectively being served by the
pointed location
The ‘bug’ you see comes from either point: Or your configuration is not
applied, or your request is being served somewhere else.
To simplify this test procedure, I strongly recommend you to come down
to a
minimal configuration avoiding useless includes until you can narrow the
problem down.
Once that done, I would then progressively add the includes again.
During that process, I would also taking the opportunity of
cleaning/reorganizing it better. That would help maintenance, and nginx
configuration as been thought to allow scalable configuration, so you
can
for sure do better than that.
Seeing the mess in your configuration, I would not call for a bug in the
most widely directive ever used by nginx, but rather call for having
creating your own doom with such poorly written conf… ;o)
Good luck,