Hi All,
Is it possible to set the limit to the number of characters that
can be present in the requested Url. which variable can i use to access
the requested url .
Thank You
Posted at Nginx Forum:
Hi All,
Is it possible to set the limit to the number of characters that
can be present in the requested Url. which variable can i use to access
the requested url .
Thank You
Posted at Nginx Forum:
Hi,
I have found that the $http_referer gives me the complete url
requested via the browser, now can some one tell me how i can count the
characters in it in Nginx.
Posted at Nginx Forum:
Thanks Igor,
But i just want my users to enter less that 70 characters into the url,
is there any way i can enforce this form Nginx, may be using the
&http_referer or the $request_length… please advice…
Thank You,
Posted at Nginx Forum:
Nope that does not work …
Posted at Nginx Forum:
I get the error when starting up Nginx with the condition
if ($request_uri ~ .{70,}) {
return 403;
: invalid condition “.” in /etc/nginx/nginx.conf
Posted at Nginx Forum:
On Wed, Nov 25, 2009 at 1:02 PM, himesh [email protected] wrote:
I get the error when starting up Nginx with the condition
if ($request_uri ~ .{70,}) {
return 403;
You need quotes here. The following has been tested on my side:
if ($request_uri ~ '.{70,}') {
return 403;
}
Cheers,
-agentzh
thank you Guys,
It Works !
Posted at Nginx Forum:
On Tue, Nov 24, 2009 at 12:24:49AM -0500, himesh wrote:
Hi All,
Is it possible to set the limit to the number of characters that can be present in the requested Url. which variable can i use to access the requested url .
You may limit buffer size for client request:
client_header_buffer_size 1k;
large_client_header_buffers 4 4k;
These are default values. If you want to limit URL to 2K, set:
client_header_buffer_size 1k;
large_client_header_buffers 4 2k;
Note, that this also limits length of any header line to 2K.
–
Igor S.
http://sysoev.ru/en/
On Tue, Nov 24, 2009 at 06:05:42AM -0500, himesh wrote:
Thanks Igor,
But i just want my users to enter less that 70 characters into the url, is there any way i can enforce this form Nginx, may be using the &http_referer or the $request_length… please advice…
You may try
server {
if ($request_uri ~ .{70,}) {
return 403;
}
–
Igor S.
http://sysoev.ru/en/
Be sure you’re using $request_uri and not $http_referer. The
$http_referer variable holds the URL of the page the user was on when
clicking a link to your site, and it may be empty (for instance, if
the URL is typed by hand). It can be helpful with tracking site usage
but should not be relied upon. Regardless, it’s the wrong variable
for what you’re trying to do.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs