Regex issue in evaluating location directive with '#' in URL

I have a requirement of configuring nginx as a reverse proxy for one of my application servers.
I intend to stop the login url of that server which reads as “ Server2.com: Home

I have trying to configure the location regex as below:

location / {
proxy_set_header
Host $host:$server_port;
}

location ~ /?/signin
{
deny all;
}

however when I try to use it with “/#/signin”, it always seeks it from location / (and not the second path)

If i try any character other than #, it always takes it from the second expression, which is what I intend to do

I cant use use # in the location regex since anything following that would be terminated.

Could you please guide me of any way to get past this issue?

Appreciate your help.

I’m not sure but:

The hash symbol (#), also known as a URL fragment, is a client-side indicator.

The browser sees # to mean not to include any following characters in the request it sends to the server. Instead, it uses the characters that follow the # to determine what part of the page to load or what client-side route to activate.

You could use JavaScript on the client-side app or block it directly in the server-side app if you can change that code.

Hope this provides some help.

Thanks @davemc, I have also tried similar approach. I have been watching the javsacript library calls in the network tab to see which all libraries being fetched from server might be responsible for that. Then I selectively blocked each of the libraries, and eventually reached to a point where all the application specific libraries are blocked. That helped me in blocking the login page. however all I can see is the empty page. Perhaps this is the best and closest solution that I could implement in this case.

Appreciate your time and help in this regard.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.