Nginx 1.7.0 failed make with Phusion Passenger?

Anyone experience this problem ? I have Nginx 1.5.13 working fine with
Phusion Passenger 4.0.37 source compile. But trying to update Nginx from
1.5.13 to 1.7.0 fails at make stage. I tried both Phusion Passenger
4.0.37
and 4.0.41 and it fails.

Working Nginx 1.5.13 configuration

nginx -V
nginx version: nginx/1.5.13
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
TLS SNI support enabled
configure arguments: --sbin-path=/usr/local/sbin
–conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module
–with-http_gzip_static_module --with-http_stub_status_module
–with-http_sub_module --with-http_addition_module
–with-http_image_filter_module --with-http_secure_link_module
–with-http_flv_module --with-http_realip_module
–with-openssl-opt=enable-tlsext
–add-module=…/ngx-fancyindex-ngx-fancyindex
–add-module=…/ngx_cache_purge-2.1
–add-module=…/headers-more-nginx-module-0.25
–add-module=…/nginx-accesskey-2.0.3
–add-module=…/nginx-http-concat-master --with-http_dav_module
–add-module=…/nginx-dav-ext-module-0.0.3
–add-module=/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.37/ext/nginx
–with-openssl=…/openssl-1.0.1g --with-libatomic
–with-pcre=…/pcre-8.35
–with-pcre-jit --with-http_spdy_module
–add-module=…/ngx_pagespeed-release-1.7.30.4-beta

Now when updating to Nginx 1.7.0 fails at this point with both Phusion
Passenger 4.0.37 and 4.0.41

passenger -v
Phusion Passenger version 4.0.41

error message

            -o objs/addon/nginx/StaticContentHandler.o \

/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/ext/nginx/StaticContentHandler.c
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/ext/nginx/StaticContentHandler.c:
In function ‘passenger_static_content_handler’:
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/ext/nginx/StaticContentHandler.c:72:
error: ‘ngx_http_request_t’ has no member named ‘zero_in_uri’
make[1]: *** [objs/addon/nginx/StaticContentHandler.o] Error 1
make[1]: Leaving directory `/svr-setup/nginx-1.7.0’
make: *** [build] Error 2


Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249586,249586#msg-249586

grep -C10 zero_in_uri
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/ext/nginx/StaticContentHandler.c
if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
return NGX_HTTP_NOT_ALLOWED;
}

if (r->uri.data[r->uri.len - 1] == '/') {
    return NGX_DECLINED;
}

#if (PASSENGER_NGINX_MINOR_VERSION == 8 && 

PASSENGER_NGINX_MICRO_VERSION
< 38) ||
(PASSENGER_NGINX_MINOR_VERSION == 7 &&
PASSENGER_NGINX_MICRO_VERSION
< 66)
if (r->zero_in_uri) {
return NGX_DECLINED;
}
#endif

log = r->connection->log;

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
               "http filename: \"%s\"", filename->data);

clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249586,249587#msg-249587

removing these lines in
/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/ext/nginx/StaticContentHandler.c
seem to have allowed it to compile properly

if (r->zero_in_uri) {
return NGX_DECLINED;
}

nginx -V
nginx version: nginx/1.7.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
TLS SNI support enabled
configure arguments: --sbin-path=/usr/local/sbin
–conf-path=/usr/local/nginx/conf/nginx.conf --with-http_ssl_module
–with-http_gzip_static_module --with-http_stub_status_module
–with-http_sub_module --with-http_addition_module
–with-http_image_filter_module --with-http_secure_link_module
–with-http_flv_module --with-http_realip_module
–with-openssl-opt=enable-tlsext
–add-module=…/ngx-fancyindex-ngx-fancyindex
–add-module=…/ngx_cache_purge-2.1
–add-module=…/headers-more-nginx-module-0.25
–add-module=…/nginx-accesskey-2.0.3
–add-module=…/nginx-http-concat-master --with-http_dav_module
–add-module=…/nginx-dav-ext-module-0.0.3
–add-module=/usr/local/rvm/gems/ruby-2.1.1/gems/passenger-4.0.41/ext/nginx
–with-openssl=…/openssl-1.0.1g --with-libatomic
–with-pcre=…/pcre-8.34
–with-pcre-jit --with-http_spdy_module
–add-module=…/ngx_pagespeed-release-1.7.30.4-beta

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249586,249588#msg-249588

I’m one of the Phusion Passenger authors. For Phusion Passenger support,
please use the Phusion Passenger discussion forum, not the Nginx forum.
It’s
here: https://groups.google.com/forum/#!forum/phusion-passenger

This is a compilation problem due to some old code which tries to
support
Nginx 0.7. I’ve just fixed this, and the fix will be available in the
next
version, 4.0.42.
https://github.com/phusion/passenger/commit/5c1a24d06a0ea5c3f6982b4ebe6322c4eb818601

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249586,249591#msg-249591

thanks for the reply and fix :slight_smile:

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249586,249595#msg-249595