To cheat location in nginx

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/ on line 274
0 like 0 dislike
Is it possible to cheat location in nginx? Or rather, canonize whether nginx URI (and always)?

Let's say I want to restrict by IP the access to the directory files/private:
location ~ ^/files/private/.*$ {
if ($remote_addr != '') {return 403;}

Understand that in this case it was possible to do without regular expressions. This is just an example.

The user can query as (common browsers automatically convert the second link). What does my location in the second case? If it works, it is always nginx canonicalize the URI before you run it by configuration? Somewhere in the documentation this is stated clearly?
by | 15 views

1 Answer

0 like 0 dislike
Try And Use X-Accel-Redirect
110,608 questions
257,186 answers
22,649 users