map problem : how to debug it ?

gperrot nginx-forum at forum.nginx.org
Tue Apr 12 09:16:04 UTC 2022


Hello,

I am using nginx/1.16.1 on CentOS Linux 7. I am using map directive for
managing a large number of redirects from one server to another server  :

map $request_uri $new_uri {
    include /etc/nginx/conf/redirect.map;
    include /etc/nginx/conf/documentation.map;
}

In /etc/nginx/conf/documentation.map, I have 1200 redirections like those
below (the first one works, the second one doesn't).

'/Documentation/Security.html#External'
'https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication';
'/Documentation/Helpers.html#AppHelpers'
'https://support.communigate.com/en/guides/communigate-pro-manual/applications/helper-applications/external-application-helpers;'

If I try to use
https://communigate.com/documentation/Helpers.html#AppHelpers (first
redirection), I have "page not found (404)" and the logs are :

162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET
/documentation//Helpers.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75
Safari/537.36"
162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET
/documentation/Helpers.html HTTP/2.0" 404 45842 "-" "Mozilla/5.0 (X11; Linux
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75
Safari/537.36"

If I try to use
https://communigate.com/documentation//Security.html#External (second
redirection), I have the page and the logs are :

141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET
/documentation//Security.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75
Safari/537.36"
141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET
/documentation/Security.html HTTP/2.0" 301 162 "-" "Mozilla/5.0 (X11; Linux
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75
Safari/537.36"

If I try to access from my nginx server to the destination URL
https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication
or

I have tested there is no synthax error in my configuration file with :

# nginx -c /etc/nginx/nginx.conf -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

I also tried systemctl reload/restart nginx without results.

Do you know how can I debug that ? Is there a way to check what are the
requests done to destination host by my nginx server ?

Thanks in advance for your help.

Gilles

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293930,293930#msg-293930



More information about the nginx mailing list