chobits / ngx_http_proxy_connect_module

A forward proxy module for CONNECT request handling
BSD 2-Clause "Simplified" License
1.75k stars 484 forks source link

arm64 can't work #297

Open wiselike opened 5 months ago

wiselike commented 5 months ago

Ⅰ. Issue Description

arm64 seems can't work

Ⅱ. Describe what happened

[root@localhost nginx-1.17.8]# curl -v -x 127.0.0.1:8443 https://www.baidu.com
*   Trying 127.0.0.1:8443...
* Connected to 127.0.0.1 (127.0.0.1) port 8443 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to www.baidu.com:443
> CONNECT www.baidu.com:443 HTTP/1.1
> Host: www.baidu.com:443
> User-Agent: curl/7.71.1
> Proxy-Connection: Keep-Alive
>

* Operation timed out after 300505 milliseconds with 0 out of 0 bytes received
* Closing connection 0
curl: (28) Operation timed out after 300505 milliseconds with 0 out of 0 bytes received
[root@localhost nginx-1.17.8]# ./nginx-proxy/sbin/nginx -V
nginx version: nginx/1.17.8
built by gcc 7.3.0 (GCC)
built with OpenSSL 1.1.1q  5 Jul 2022
TLS SNI support enabled
configure arguments: --prefix=./nginx-proxy --with-openssl=/root/works/openssl-1.1.1q --with-http_ssl_module --with-pcre --with-http_ssl_module --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_v2_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-compat --add-module=../ngx_http_proxy_connect_module-master --with-cc-opt=-static --with-ld-opt=-static

here is my conf file

user  root;
worker_processes  2;

error_log  logs/error.log;
error_log  logs/error.log  debug;
#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;

    keepalive_timeout  65;

    #gzip  on;

    server {  
        resolver 8.8.8.8; 
        listen 8880;  
        location / {  
            proxy_pass http://$http_host$request_uri;
            proxy_set_header HOST $http_host;
            proxy_buffers 256 4k;
            proxy_max_temp_file_size 0k; 
            proxy_connect_timeout 30;
            proxy_send_timeout 60;
            proxy_read_timeout 60;
            proxy_next_upstream error timeout invalid_header http_502;
        }  
    }

    server {
        listen                         8443;

        # dns resolver used by forward proxying
        resolver                       8.8.8.8;

        # forward proxy for CONNECT request
        proxy_connect;
        proxy_connect_allow            443 563;
        proxy_connect_connect_timeout  10s;
        proxy_connect_read_timeout     10s;
        proxy_connect_send_timeout     10s;

        # forward proxy for non-CONNECT request
        location / {
            proxy_pass http://$host;
            proxy_set_header Host $host;
        }
    }

}

Ⅳ. How to reproduce it (as minimally and precisely as possible)

here is my build method:


tar xf nginx-1.17.8.tar.gz;
unzip ngx_http_proxy_connect_module-master.zip;

cd nginx-1.17.8;
patch -p1 < ../ngx_http_proxy_connect_module-master/patch/proxy_connect_rewrite_1018.patch;

./configure --prefix=./nginx-proxy --with-http_ssl_module --with-pcre --with-http_ssl_module --with-select_module --with-poll_module --with-threads --with-file-aio --with-http_v2_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-compat --add-module=../ngx_http_proxy_connect_module-master --with-cc-opt=-static --with-ld-opt=-static
make -j 8;
make install;
```sh
chobits commented 4 months ago

enable your nginx debug log and check it and post it here when you use curl to connect it.