Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I rebuild nginx offical docker image with this module? #185

Closed
AndyManastorm opened this issue Apr 1, 2021 · 5 comments
Closed

Comments

@AndyManastorm
Copy link

registry on dockerhub: https://registry.hub.docker.com/_/nginx/

@AndyManastorm
Copy link
Author

Tried this one with nginx-1.19.6

git clone git@github.com:nginxinc/docker-nginx.git
git checkout -b 1.19.6 1.19.6
cd mainline/alpine/
docker build  -t nginx:mainline-alpine .

git checkout master
cd ../../modules
mkdir httpproxy
# use the latest version, which is claimed to be compatible with nginx:1.19.6
echo "https://github.com/chobits/ngx_http_proxy_connect_module/archive/refs/tags/v0.0.2.tar.gz" > httpproxy/source
docker build -f "Dockerfile.alpine" --build-arg ENABLED_MODULES="httpproxy" -t nginx-with-httpproxy .

but it failed with this:

...

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

make[1]: Entering directory '/tmp/build_module.sh.21/pkg-oss/alpine/abuild-module-httpproxy/src/nginx-1.19.6'
make -f objs/Makefile modules
make[2]: Entering directory '/tmp/build_module.sh.21/pkg-oss/alpine/abuild-module-httpproxy/src/nginx-1.19.6'
gcc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Os -fomit-frame-pointer  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
	-o objs/addon/httpproxy-1.19.6/ngx_http_proxy_connect_module.o \
	../httpproxy-1.19.6/ngx_http_proxy_connect_module.c
gcc -c -fPIC -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Os -fomit-frame-pointer  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
	-o objs/ngx_http_proxy_connect_module_modules.o \
	objs/ngx_http_proxy_connect_module_modules.c
In file included from src/core/ngx_core.h:60,
                 from ../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:7:
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_upstream_handler':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1002:24: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1002 |                    &r->connect_host, &r->connect_port);
      |                        ^~~~~~~~~~~~
src/core/ngx_log.h:93:48: note: in definition of macro 'ngx_log_debug'
   93 |         ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__)
      |                                                ^~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1000:5: note: in expansion of macro 'ngx_log_debug2'
 1000 |     ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
      |     ^~~~~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1002:42: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port'; did you mean 'connection'?
 1002 |                    &r->connect_host, &r->connect_port);
      |                                          ^~~~~~~~~~~~
src/core/ngx_log.h:93:48: note: in definition of macro 'ngx_log_debug'
   93 |         ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__)
      |                                                ^~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1000:5: note: in expansion of macro 'ngx_log_debug2'
 1000 |     ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
      |     ^~~~~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_check_broken_connection':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1310:35: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1310 |                    ev->write, &r->connect_host, &r->connect_port);
      |                                   ^~~~~~~~~~~~
src/core/ngx_log.h:93:48: note: in definition of macro 'ngx_log_debug'
   93 |         ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__)
      |                                                ^~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1308:5: note: in expansion of macro 'ngx_log_debug3'
 1308 |     ngx_log_debug3(NGX_LOG_DEBUG_HTTP, ev->log, 0,
      |     ^~~~~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1310:53: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port'; did you mean 'connection'?
 1310 |                    ev->write, &r->connect_host, &r->connect_port);
      |                                                     ^~~~~~~~~~~~
src/core/ngx_log.h:93:48: note: in definition of macro 'ngx_log_debug'
   93 |         ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__)
      |                                                ^~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1308:5: note: in expansion of macro 'ngx_log_debug3'
 1308 |     ngx_log_debug3(NGX_LOG_DEBUG_HTTP, ev->log, 0,
      |     ^~~~~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_handler':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1459:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 1459 |     if (r->method != NGX_HTTP_CONNECT || !plcf->accept_connect) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1459:22: note: each undeclared identifier is reported only once for each function it appears in
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1487:30: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1487 |             url.url.len = r->connect_host.len;
      |                              ^~~~~~~~~~~~
      |                              connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1488:31: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1488 |             url.url.data = r->connect_host.data;
      |                               ^~~~~~~~~~~~
      |                               connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1492:26: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1492 |         url.url.len = r->connect_host.len;
      |                          ^~~~~~~~~~~~
      |                          connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1493:27: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1493 |         url.url.data = r->connect_host.data;
      |                           ^~~~~~~~~~~~
      |                           connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1496:27: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1496 |     url.default_port = r->connect_port_n;
      |                           ^~~~~~~~~~~~~~
      |                           connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1541:55: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1541 |     u->resolved->port = (in_port_t) (url.no_port ? r->connect_port_n : url.port);
      |                                                       ^~~~~~~~~~~~~~
      |                                                       connection
In file included from src/core/ngx_core.h:60,
                 from ../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:7:
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1577:27: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_host'; did you mean 'connection'?
 1577 |                       &r->connect_host);
      |                           ^~~~~~~~~~~~
src/core/ngx_log.h:86:67: note: in definition of macro 'ngx_log_error'
   86 |     if ((log)->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__)
      |                                                                   ^~~~~~~~~~~
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_allow_handler':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1653:41: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1653 |             if ((ports[i][1] == 0 && r->connect_port_n == ports[i][0])
      |                                         ^~~~~~~~~~~~~~
      |                                         connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1654:39: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1654 |                 || (ports[i][0] <= r->connect_port_n && r->connect_port_n <= ports[i][1]))
      |                                       ^~~~~~~~~~~~~~
      |                                       connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1654:60: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1654 |                 || (ports[i][0] <= r->connect_port_n && r->connect_port_n <= ports[i][1]))
      |                                                            ^~~~~~~~~~~~~~
      |                                                            connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1662:16: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1662 |         if (r->connect_port_n == 443 || r->connect_port_n == 563) {
      |                ^~~~~~~~~~~~~~
      |                connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:1662:44: error: 'ngx_http_request_t' {aka 'struct ngx_http_request_s'} has no member named 'connect_port_n'; did you mean 'connection'?
 1662 |         if (r->connect_port_n == 443 || r->connect_port_n == 563) {
      |                                            ^~~~~~~~~~~~~~
      |                                            connection
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_variable_get_time':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2014:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2014 |     if (r->method != NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_variable_set_time':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2051:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2051 |     if (r->method != NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_resolve_time_variable':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2093:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2093 |     if (r->method != NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_connect_time_variable':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2150:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2150 |     if (r->method != NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_variable_get_response':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2203:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2203 |     if (r->method != NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_variable_set_response':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2231:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2231 |     if (r->method != NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c: In function 'ngx_http_proxy_connect_post_read_handler':
../httpproxy-1.19.6/ngx_http_proxy_connect_module.c:2269:22: error: 'NGX_HTTP_CONNECT' undeclared (first use in this function); did you mean 'NGX_HTTP_CONFLICT'?
 2269 |     if (r->method == NGX_HTTP_CONNECT) {
      |                      ^~~~~~~~~~~~~~~~
      |                      NGX_HTTP_CONFLICT
make[2]: *** [objs/Makefile:1220: objs/addon/httpproxy-1.19.6/ngx_http_proxy_connect_module.o] Error 1
make[1]: *** [Makefile:14: modules] Error 2
make[2]: Leaving directory '/tmp/build_module.sh.21/pkg-oss/alpine/abuild-module-httpproxy/src/nginx-1.19.6'
make[1]: Leaving directory '/tmp/build_module.sh.21/pkg-oss/alpine/abuild-module-httpproxy/src/nginx-1.19.6'
>>> ERROR: nginx-module-httpproxy: build failed
Command exited with non-zero status 1
real 3.84
user 2.74
sys 1.12
make: *** [Makefile:133: module-httpproxy] Error 1
build_module.sh: ERROR: Build failed

...

@ndtreviv
Copy link

ndtreviv commented Jun 8, 2021

You have to build nginx from source. Here's how I'm doing it: #136 (comment)

@AndyManastorm
Copy link
Author

You have to build nginx from source. Here's how I'm doing it: #136 (comment)

No doubt it will work, thanks.

Nginx's offical document is awful..
https://github.com/nginxinc/docker-nginx/tree/master/modules

@chobits
Copy link
Owner

chobits commented Jul 3, 2021

Yeah, u need patch nginx core before building

@chobits
Copy link
Owner

chobits commented Jul 3, 2021

think it resolved

@chobits chobits closed this as completed Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants