map problem : how to debug it ?

Igor Ippolitov iippolitov at
Wed Apr 13 10:45:15 UTC 2022


When you enter a url with an anchor into a browser, the browser will 
only request a URL without the anchor from the web server.
The web servers gets only the part you see in logs.
For '/Doc.html#case1' the web server will receive a request for 
'/Doc.html'. The anchor is used by the browser itself to navigate within 
a page.

You can't rely on the anchor part to make decisions on the web server side.

AFAIK, the anchors were initially to scroll to a an element with a 
corresponding ID.
Later it was reused by JS frameworks to build navigation within so 
called single page applications.

This link may help: 
(note that it also uses an anchor ;)

To sum it up: there is no solution to the problem you are asking about.
But most likely this is an XY problem: .

Hope this helps,

On 13.04.2022 10:41, gperrot wrote:
> Thanks a lot for all your answers !
> Since I have the case below with anchor (fragment-ID in URL to map to one
> specific action in my :
> /Doc.html#case1;
> /Doc.html#case2;
> /Doc.html;
> How can I do this kind of mapping with Nginx ?
> For the moment, my conf is :
> map $uri $new_uri {
>      include /etc/nginx/conf/;
> }
> If I type, the map for action3 works but if I
> type or
>, the map doesn't work.
> Any idea how to solve that ?
> Thanks in advance for your help.
> Gilles
> Posted at Nginx Forum:,293930,293948#msg-293948
> _______________________________________________
> nginx mailing list -- nginx at
> To unsubscribe send an email to nginx-leave at

More information about the nginx mailing list