GEOIP context problem

Sergey A. Osokin osa at FreeBSD.ORG.ru
Tue Aug 31 11:37:25 MSD 2010


On Tue, Aug 31, 2010 at 12:18:13AM -0400, syle wrote:
> There is a problem with current 0.8.x release of GEOIP although I assume
> it has always not worked, where these variables:
> fastcgi_param GEOIP_CITY_COUNTRY_CODE $geoip_city_country_code;
> fastcgi_param GEOIP_CITY_COUNTRY_CODE3 $geoip_city_country_code3;
> fastcgi_param GEOIP_CITY_COUNTRY_NAME $geoip_city_country_name;
> fastcgi_param GEOIP_REGION $geoip_region;
> fastcgi_param GEOIP_CITY $geoip_city;
> fastcgi_param GEOIP_POSTAL_CODE $geoip_postal_code;
> fastcgi_param GEOIP_CITY_CONTINENT_CODE $geoip_city_continent_code;
> fastcgi_param GEOIP_LATITUDE $geoip_latitude;
> fastcgi_param GEOIP_LONGITUDE $geoip_longitude;
> 
> do not work except inside the fastcgi_params file. The context is
> suppose to work within http as per module documentation however setting
> these variables
> within http context ends up not setting them at all.
> 
> This is currently a major issue especially in freebsd where an upgrade
> of version from port collections can wipe out fastcgi_params file each
> time, leaving
> any webserver relying on these variables in major trouble if they were
> to forget to replace fastcgi_params file afterwards.

Could you test following patch against current version of
ports/www/nginx-devel ?

Thank you.

-- 
Sergey A. Osokin,
osa at FreeBSD.ORG.ru
osa at FreeBSD.ORG
-------------- next part --------------
Index: ports/www/nginx-devel/Makefile
===================================================================
RCS file: /home/pcvs/ports/www/nginx-devel/Makefile,v
retrieving revision 1.338
diff -u -r1.338 Makefile
--- ports/www/nginx-devel/Makefile	18 Aug 2010 09:37:34 -0000	1.338
+++ ports/www/nginx-devel/Makefile	31 Aug 2010 07:34:04 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	nginx
 PORTVERSION=	0.8.49
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	http://sysoev.ru/nginx/
 MASTER_SITES+=	${MASTER_SITE_LOCAL}
@@ -498,10 +499,10 @@
 	${MKDIR} ${ETCDIR} ${NGINX_TMPDIR}
 	${CHOWN} ${WWWOWN}:${WWWGRP} ${NGINX_TMPDIR}
 	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${PREFIX}/sbin
-.for i in fastcgi_params koi-utf koi-win scgi_params uwsgi_params win-utf
+.for i in koi-utf koi-win win-utf
 	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${ETCDIR}
 .endfor
-.for i in mime.types nginx.conf
+.for i in fastcgi_params mime.types nginx.conf scgi_params uwsgi_params
 	[ -f ${ETCDIR}/${i} ] || \
 		${INSTALL_DATA} ${WRKSRC}/conf/${i} ${ETCDIR}
 	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${ETCDIR}/${i}-dist
Index: ports/www/nginx-devel/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/www/nginx-devel/pkg-plist,v
retrieving revision 1.14
diff -u -r1.14 pkg-plist
--- ports/www/nginx-devel/pkg-plist	14 Jul 2010 12:19:44 -0000	1.14
+++ ports/www/nginx-devel/pkg-plist	31 Aug 2010 07:34:04 -0000
@@ -1,9 +1,15 @@
 @comment $FreeBSD: ports/www/nginx-devel/pkg-plist,v 1.14 2010/07/14 12:19:44 osa Exp $
+ at unexec if cmp -s %D/%%ETCDIR%%/fastcgi_params-dist %D/%%ETCDIR%%/fastcgi_params; then rm -f %D/%%ETCDIR%%/fastcgi_params; fi
 %%ETCDIR%%/fastcgi_params
+ at exec if [ ! -f %D/%%ETCDIR%%/fastcgi_params ] ; then cp -p %D/%F %B/fastcgi_params; fi
 %%ETCDIR%%/koi-utf
 %%ETCDIR%%/koi-win
+ at unexec if cmp -s %D/%%ETCDIR%%/scgi_params-dist %D/%%ETCDIR%%/scgi_params; then rm -f %D/%%ETCDIR%%/scgi_params; fi
 %%ETCDIR%%/scgi_params
+ at exec if [ ! -f %D/%%ETCDIR%%/scgi_params ] ; then cp -p %D/%F %B/scgi_params; fi
+ at unexec if cmp -s %D/%%ETCDIR%%/uwsgi_params-dist %D/%%ETCDIR%%/uwsgi_params; then rm -f %D/%%ETCDIR%%/uwsgi_params; fi
 %%ETCDIR%%/uwsgi_params
+ at exec if [ ! -f %D/%%ETCDIR%%/uwsgi_params ] ; then cp -p %D/%F %B/uwsgi_params; fi
 %%ETCDIR%%/win-utf
 @unexec if cmp -s %D/%%ETCDIR%%/mime.types-dist %D/%%ETCDIR%%/mime.types; then rm -f %D/%%ETCDIR%%/mime.types; fi
 %%ETCDIR%%/mime.types-dist


More information about the nginx mailing list