Opened 9 years ago

Closed 9 years ago

#748 closed defect (invalid)

proxy_pass not working on arm with nginx 1.6.3

Reported by: Jürn Brodersen Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.6.x
Keywords: Cc:
uname -a: Linux alarmpi 3.18.11-2-ARCH #1 PREEMPT Sat Apr 11 12:37:48 MDT 2015 armv6l GNU/Linux
nginx -V: nginx version: nginx/1.6.3
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --user=http --group=http --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --http-client-body-temp-path=/var/lib/nginx/client-body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-imap --with-imap_ssl_module --with-ipv6 --with-pcre-jit --with-file-aio --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_spdy_module --with-http_ssl_module --with-http_stub_status_module --with-http_addition_module --with-http_degradation_module --with-http_flv_module --with-http_mp4_module --with-http_secure_link_module --with-http_sub_module

Description

The worker process dies when trying to connect to a service through nginx reverse_proxy. No data is served.
This function is working normally on x86_64.
Version 1.6.2 doesn't have this bug.

Configuration:

#user html;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen    7777;
        
        location / {
            proxy_pass http://127.0.0.1:9999;
        }
    }
}

Change History (4)

comment:1 by Sergey Kandaurov, 9 years ago

Do configure options differ between 1.6.2 and 1.6.3 versions in your builds?
Do you cross-built nginx on arm?
I wonder because you don't have "built by <compiler>" line in 'nginx -V',
e.g.: built by gcc 4.9.1 (Ubuntu 4.9.1-1ubuntu2~14.04.3)

What do you have in your debug error.log when the worker process dies?
See http://nginx.org/en/docs/debugging_log.html for more details.

Last edited 9 years ago by Sergey Kandaurov (previous) (diff)

comment:2 by Daniel Jönsson, 9 years ago

I solved it by recompiling nginx using the PKGBUILD from the ALARM repo.
https://github.com/archlinuxarm/PKGBUILDs/tree/master/extra/nginx

uname -a

Linux webpi 3.12.35-1-ARCH #1 PREEMPT Tue Dec 23 07:14:51 MST 2014 armv6l GNU/Linux

nginx -V

nginx version: nginx/1.6.3
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/bin/nginx --pid-path=/run/nginx.pid --lock-path=/run/lock/nginx.lock --user=http --group=http --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --http-client-body-temp-path=/var/lib/nginx/client-body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-imap --with-imap_ssl_module --with-ipv6 --with-pcre-jit --with-file-aio --with-http_dav_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-http_spdy_module --with-http_ssl_module --with-http_stub_status_module --with-http_addition_module --with-http_degradation_module --with-http_flv_module --with-http_mp4_module --with-http_secure_link_module --with-http_sub_module

comment:3 by Jürn Brodersen, 9 years ago

This was solved by adding -fPIE -pie as build flags:
https://github.com/archlinuxarm/PKGBUILDs/issues/1161
I must admit that I don't really know what that does. I tried to enable debugging but that also solves the bug.

If you want to reproduce this make sure the hardening-wrapper package isn't installed when building nginx because that also solves this.
GCC Version used: 4.9.2 on a Raspberry Pi with ArchLinuxARM

So this can probably be closed.
Thanks

comment:4 by Sergey Kandaurov, 9 years ago

Resolution: invalid
Status: newclosed

Ok, thanks for detailed feedback.

Note: See TracTickets for help on using tickets.