I am using NGINX version 1.19.10 on docker environment.
when I have below location
prefix; I can access TXT file successfully via http://example.com/abs.txt
location /abs\.txt {
alias /usr/abs.txt }
when I include underscore
in location
prefix; I failed to access TXT file via http://example.com/abs_support_AB58gLoD.txt end up with error 404 NOT Found
.
location /abs_support_AB58gLoD\.txt {
alias /usr/abs.txt }
Within the same NGINX config file, exactly the same location
prefix (with underscore
) setup in another server
directive with different FQDN , worked perfectly.
I am completely lost and could not find out why. I follow docs to enable access log / error log, but it is completely empty in the file.
--Add Troubleshooting Output--
I change location
prefix to below, I can access http://example.com/abs_support_AB58gLo.txt successfully. but when I append the last D
to the filename, http://example.com/abs_support_AB58gLoD\.txt, I failed with 500 Internal Error
.
location ~ /MP.*\.txt {}
I tried underscores_in_headers on;
as well, problem persisted.