Closed Chathu07 closed 2 years ago
https://github.com/openresty/srcache-nginx-module/pull/97 is the culprit. I think a workaround would be to change the Nginx version being compiled
You can download the nginx-ee
repo and then run ./nginx-build.sh --stable
from within the nginx-ee
directory.
However, I found that --stable
does not work due to the line in nginx-build.sh
:
NGINX_STABLE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 2 | grep 1.20 2>&1)"
which I commented out and replaced with:
NGINX_STABLE="1.22.0"
You can download the
nginx-ee
repo and then run./nginx-build.sh --stable
from within thenginx-ee
directory. However, I found that--stable
does not work due to the line innginx-build.sh
:NGINX_STABLE="$(curl -sL https://nginx.org/en/download.html 2>&1 | grep -E -o 'nginx\-[0-9.]+\.tar[.a-z]*' | awk -F "nginx-" '/.tar.gz$/ {print $2}' | sed -e 's|.tar.gz||g' | head -n 2 | grep 1.20 2>&1)"
which I commented out and replaced with:
NGINX_STABLE="1.22.0"
Thank you for your reply. Any way to install the mainline?
There's a new Mainline version, but still not possible to compile it. :(
Hello, yes there were breaking changes with the nginx-redis extension. I'm going to check what is wrong and if it can be fixed
Hello! I also using hetzner vps, and when try to update (pagespeed stable, dynamic modules, and openssl 3.0.0-dev) I get this error:
tail /tmp/nginx-ee.log
../incubator-pagespeed-ngx-latest-stable/src/ngx_pagespeed.cc: In function ‘bool net_instaweb:: {anonymous}::ps_get_cache_control(ngx_http_request_t*, GoogleString*)’:
../incubator-pagespeed-ngx-latest-stable/src/ngx_pagespeed.cc:439:74: error: request for member ‘elts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which is of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
439 | auto ccp = static_cast<ngx_table_elt_t**>(r->headers_out.cache_control.elts);
| ^~~~
../incubator-pagespeed-ngx-latest-stable/src/ngx_pagespeed.cc:444:59: error: request for member ‘nelts’ in ‘r->ngx_http_request_s::headers_out.ngx_http_headers_out_t::cache_control’, which i s of pointer type ‘ngx_table_elt_t*’ {aka ‘ngx_table_elt_s*’} (maybe you meant to use ‘->’ ?)
444 | for (ngx_uint_t i = 0; i < r->headers_out.cache_control.nelts; i++) {
| ^~~~~
make[1]: *** [objs/Makefile:1881: objs/addon/src/ngx_pagespeed.o] Error 1
make[1]: Leaving directory '/usr/local/src/nginx'
make: *** [Makefile:13: install] Error 2
Hello, I'm not using hetzner vps, I'm using ubuntu in Auzre and I have the exact same problem of error during build due to ngx-http_redis. @VirtuBox hoping you can fix this for us. Here is the error in nginx-ee.log:
../ngx_http_redis/ngx_http_redis_module.c: In function ‘ngx_http_redis_process_header’:
../ngx_http_redis/ngx_http_redis_module.c:585:26: error: ‘ngx_http_upstream_headers_in_t’ {aka ‘struct <anonymous>’} has no member named ‘content_encoding’
585 | u->headers_in.content_encoding = h;
| ^
objs/Makefile:1633: recipe for target 'objs/addon/ngx_http_redis/ngx_http_redis_module.o' failed
make[1]: *** [objs/addon/ngx_http_redis/ngx_http_redis_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/usr/local/src/nginx'
Makefile:10: recipe for target 'build' failed
make: *** [build] Error 2
I have removed ngx_http_redis module as you can use redis2-nginx-module directive to do the same.
Will there be a release to address this detail?
Hi @VirtuBox , I just compiled without the ngx_http_redis module and while the compile worked, my NGINX caching is now broken. (I run wordops but use nginx-ee to compile nginx because I need to add the Modsecurity module.)
After successful compile, nginx -t failed with: nginx: [emerg] unknown directive "redis_pass" in /etc/nginx/common/redis-php73.conf:26
so then I changed redis_pass to redis2_pass. This allowed nginx -t to pass. After doing this and testing on my site, I always see x-srcache-fetch-status MISS
Debugging NGINX shows this error now:
2022/10/06 12:05:24 [error] 24473#24473: *1 no redis2 query specified or the query is empty, client: 73.94.187.209, server: dev.wholesomeyum.com, request: "GET /recipes/sugar-free-maple-syrup/ HTTP/2.0", subrequest: "/redis-fetch", host: "dev.wholesomeyum.com", referrer: "https://dev.wholesomeyum.com/"
When I check redis cache, I see the page that I'm testing against show up in redis cache correctly.
Do you think the problem is that ngx_http_redis is actually needed in some way? Or the caching config needs to be changed more to reflect the removal of this module?
Any help you can provide will be great as I'm stuck.
Attach the following commands output
This is part of the
/tmp/nginx-ee.log
. GitHub does not allow posting all the logs.