Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
To cheat location in nginx - code-flow.club | Q&A

To cheat location in nginx


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
17 views
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 != '127.0.0.1') {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 example.org/files/private/my.zipand http://example.org/files/./private/my.zip (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 | 17 views

1 Answer

0 like 0 dislike
Try And Use X-Accel-Redirect
by
110,608 questions
257,186 answers
0 comments
35,181 users