GEOIP context problem

syle nginx-forum at
Tue Aug 31 19:38:38 MSD 2010

Actually I'll post one of my server directives so we can see if there is
any inheritance problems like 
you suggested, i have about 50 server directives the same as this: 
( I know it seems quite bloated but I didn't read any way I could set
php and perl/cgi scripts outside of 
server directivesfor all the vhosts)

server {
    listen       80;#bind to ipv4
    listen       [::]:80; #bind to ipv6
    server_name  x.x.x;
    root   /xxx/xxx/xxx;
    access_log  /usr/nginx_logs/xxx_xxx_log main;
    error_log  /usr/nginx_logs/xxx_xxx_error;
    index  index.php index.html;
    error_page  404              /xxx/;
    error_page   500 502 503 504  /xxx/;
    location ~ \.php$ {
        fastcgi_index  index.php;
        fastcgi_pass  unix:/tmp/cgi2.sock;
        fastcgi_param  SCRIPT_FILENAME
        include        fastcgi_params;
    location ~ \.pl$ {
        fastcgi_pass  unix:/tmp/cgi.sock;
        fastcgi_param  SCRIPT_FILENAME
        include        fastcgi_params;

---- i do see params being set in location as you said would not work,
So are you saying i would have to add all those GEO_IP directives to all
50 server directives :(  perhaps maybe can suggest a way to move these
perl and php directives outside server directives into http context to
work with GEOIP? or I have to hope for a freebsd commit to stop removing
that file I suppose.

Posted at Nginx Forum:,125449,125687#msg-125687

More information about the nginx mailing list