forked from nginx/nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*) Feature: the listen(2) backlog in the "listen" directive can be changed using the -HUP signal. *) Feature: the geo2nginx.pl script was added to contrib. *) Change: the FastCGI parameters with the empty values now are passed to a server. *) Bugfix: the segmentation fault occurred or the worker process may got caught in an endless loop if the proxied or FastCGI server sent the "Cache-Control" header line and the "expires" directive was used; in the proxied mode the the bug had appeared in 0.1.29.
- Loading branch information
1 parent
e3c2cf8
commit e503539
Showing
19 changed files
with
266 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
fastcgi_param QUERY_STRING $query_string; | ||
fastcgi_param REQUEST_METHOD $request_method; | ||
fastcgi_param CONTENT_TYPE $content_type; | ||
fastcgi_param CONTENT_LENGTH $content_length; | ||
|
||
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | ||
fastcgi_param REQUEST_URI $request_uri; | ||
fastcgi_param DOCUMENT_URI $document_uri; | ||
fastcgi_param DOCUMENT_ROOT $document_root; | ||
fastcgi_param SERVER_PROTOCOL $server_protocol; | ||
|
||
fastcgi_param GATEWAY_INTERFACE CGI/1.1; | ||
fastcgi_param SERVER_SOFTWARE nginx; | ||
|
||
fastcgi_param REMOTE_ADDR $remote_addr; | ||
fastcgi_param REMOTE_PORT $remote_port; | ||
fastcgi_param SERVER_ADDR $server_addr; | ||
fastcgi_param SERVER_PORT $server_port; | ||
fastcgi_param SERVER_NAME $server_name; | ||
|
||
# PHP only, required if PHP was built with --enable-force-cgi-redirect | ||
fastcgi_param REDIRECT_STATUS 200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
geo2nginx.pl by Andrei Nigmatulin | ||
|
||
The perl script to convert CSV geoip database (free download | ||
at http://www.maxmind.com/app/geoip_country) to format, suitable | ||
for use with ngx_http_geo_module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/perl -w | ||
|
||
# (c) Andrei Nigmatulin, 2005 | ||
# | ||
# this script provided "as is", without any warranties. use it at your own risk. | ||
# | ||
# special thanx to Andrew Sitnikov for perl port | ||
# | ||
# this script converts CSV geoip database (free download at http://www.maxmind.com/app/geoip_country) | ||
# to format, suitable for use with nginx_http_geo module (http://sysoev.ru/nginx) | ||
# | ||
# for example, line with ip range | ||
# | ||
# "62.16.68.0","62.16.127.255","1041253376","1041268735","RU","Russian Federation" | ||
# | ||
# will be converted to four subnetworks: | ||
# | ||
# 62.16.68.0/22 RU; | ||
# 62.16.72.0/21 RU; | ||
# 62.16.80.0/20 RU; | ||
# 62.16.96.0/19 RU; | ||
|
||
|
||
use warnings; | ||
use strict; | ||
|
||
while( <STDIN> ){ | ||
if (/"[^"]+","[^"]+","([^"]+)","([^"]+)","([^"]+)"/){ | ||
print_subnets($1, $2, $3); | ||
} | ||
} | ||
|
||
sub print_subnets { | ||
my ($a1, $a2, $c) = @_; | ||
my $l; | ||
while ($a1 <= $a2) { | ||
for ($l = 0; ($a1 & (1 << $l)) == 0 && ($a1 + ((1 << ($l + 1)) - 1)) <= $a2; $l++){}; | ||
print long2ip($a1) . "/" . (32 - $l) . " " . $c . ";\n"; | ||
$a1 += (1 << $l); | ||
} | ||
} | ||
|
||
sub long2ip { | ||
my $ip = shift; | ||
|
||
my $str = 0; | ||
|
||
$str = ($ip & 255); | ||
|
||
$ip >>= 8; | ||
$str = ($ip & 255).".$str"; | ||
|
||
$ip >>= 8; | ||
$str = ($ip & 255).".$str"; | ||
|
||
$ip >>= 8; | ||
$str = ($ip & 255).".$str"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.