From fusca14 at gmail.com Mon Apr 4 19:28:54 2022 From: fusca14 at gmail.com (Fabiano Furtado Pessoa Coelho) Date: Mon, 4 Apr 2022 16:28:54 -0300 Subject: Feature request to "access_log" directive Message-ID: Hi... Sorry to bother you with this feature request. I believe you software engineers already thought about it and there are a million reasons to not implement it. Well, I'm exactly in this situation described here https://serverfault.com/questions/498799/how-to-log-nginx-requests-made-to-a-specific-location-in-a-different-file I want to use "try_files" and log the access within the location with "try_files" directive... location /my_system { access_log /var/log/nginx/my_system_access.log; try_files $uri @named_loc; } location @named_loc { access_log off; proxy_pass http://...; } ... and I can't! "Requests are logged in the context of a location where processing ends. It may be different from the original location, if an internal redirect happens during request processing." I can make it work using the "#include" directive and removing the named location, but using "try_files" is more clean and sophisticated. Is there a way to include the "now" directive to "access_log"? Something like: "access_log /var/log/nginx/my_system_access.log now;" Thanks in advance. Fabiano From nginx-forum at forum.nginx.org Tue Apr 5 22:01:33 2022 From: nginx-forum at forum.nginx.org (adhprash) Date: Tue, 05 Apr 2022 18:01:33 -0400 Subject: Help with ssl_write() failed issue on nginx In-Reply-To: <9331538ca041268eea8a134ee0c6ec35.NginxMailingListEnglish@forum.nginx.org> References: <9331538ca041268eea8a134ee0c6ec35.NginxMailingListEnglish@forum.nginx.org> Message-ID: <45a243e69cb2a6daf6f1b6d1bb5975b1.NginxMailingListEnglish@forum.nginx.org> Do you need any more information? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293852,293906#msg-293906 From wmjhappy_ok at 126.com Tue Apr 5 23:15:47 2022 From: wmjhappy_ok at 126.com (=?UTF-8?B?546L5piO5ZCb?=) Date: Wed, 6 Apr 2022 07:15:47 +0800 (GMT+08:00) Subject: Njs Utility not working Message-ID: <7ddac134.29b0.17ffc0345e1.Coremail.wmjhappy_ok@126.com> Hi, i'm trying to build only njs command-line utility following http://nginx.org/en/docs/njs/install.html, but the final njs does not work as expected. See this mail's attached file to find out how i was trying. uname -a Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux cat os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" -------------- next part -------------- An HTML attachment was scrubbed... URL: From xeioex at nginx.com Wed Apr 6 01:49:10 2022 From: xeioex at nginx.com (Dmitry Volyntsev) Date: Tue, 5 Apr 2022 18:49:10 -0700 Subject: Njs Utility not working In-Reply-To: <7ddac134.29b0.17ffc0345e1.Coremail.wmjhappy_ok@126.com> References: <7ddac134.29b0.17ffc0345e1.Coremail.wmjhappy_ok@126.com> Message-ID: <8652871f-25a4-4cf4-002b-c8d9a5a1240a@nginx.com> Hi, Please attach the configure output. If njs CLI was built successfully, but the binary does not work in terminal mode. The reason is libreadline was not found during configure phase. On 05.04.2022 16:15, 王明君 wrote: > Hi, i'm trying to build only njs command-line utility following > _http://nginx.org/en/docs/njs/install.html_, but the final njs does > not work as expected. See this mail's attached file to find out how i > was trying. > > *uname -a* > Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 > 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux > > *cat os-release* > NAME="CentOS Linux" > VERSION="7 (Core)" > ID="centos" > ID_LIKE="rhel fedora" > VERSION_ID="7" > PRETTY_NAME="CentOS Linux 7 (Core)" > ANSI_COLOR="0;31" > CPE_NAME="cpe:/o:centos:centos:7" > HOME_URL="https://www.centos.org/" > BUG_REPORT_URL="https://bugs.centos.org/" > > CENTOS_MANTISBT_PROJECT="CentOS-7" > CENTOS_MANTISBT_PROJECT_VERSION="7" > REDHAT_SUPPORT_PRODUCT="centos" > REDHAT_SUPPORT_PRODUCT_VERSION="7" > > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From wmjhappy_ok at 126.com Wed Apr 6 02:04:58 2022 From: wmjhappy_ok at 126.com (=?utf-8?B?546L5piO5ZCb?=) Date: Wed, 6 Apr 2022 10:04:58 +0800 (GMT+08:00) Subject: Njs Utility not working In-Reply-To: <8652871f-25a4-4cf4-002b-c8d9a5a1240a@nginx.com> References: <7ddac134.29b0.17ffc0345e1.Coremail.wmjhappy_ok@126.com> <8652871f-25a4-4cf4-002b-c8d9a5a1240a@nginx.com> Message-ID: <122bfc81.3274.17ffc9e2b1e.Coremail.wmjhappy_ok@126.com> Thanks for helping me. As you reminded, i found this log: checking for GNU readline library ... not found checking for editline library in editline/readline.h ... not found checking for editline in edit/readline/readline.h ... not found checking for editline in readline/readline.h ... not found - njs CLI is built without interactive shell support So, what can i do to solve this? I'm actually not much experienced Full configure output: ------------------------------------------------- configuring for Linux 3.10.0-1062.9.1.el7.x86_64 x86_64 checking for C compiler: cc + using GNU C compiler + gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) checking for sizeof(int) ... 4 checking for sizeof(u_int) ... 4 checking for sizeof(void *) ... 8 checking for sizeof(uintptr_t) ... 8 checking for sizeof(size_t) ... 8 checking for sizeof(off_t) ... 8 checking for sizeof(time_t) ... 8 checking for system byte ordering ... little checking for GCC unsigned __int128 ... found checking for GCC __builtin_expect() ... found checking for GCC __builtin_unreachable() ... found checking for GCC __builtin_prefetch() ... found checking for GCC __builtin_clz() ... found checking for GCC __builtin_clzll() ... found checking for GCC __attribute__ visibility ... found checking for GCC __attribute__ malloc ... found checking for GCC __attribute__ aligned ... found checking for GCC __attribute__ packed ... found checking for Address sanitizer ... not found checking for Memory sanitizer ... not found checking for _mm_setcsr() ... found checking for clock_gettime(CLOCK_MONOTONIC) ... found checking for struct tm.tm_gmtoff ... found checking for altzone ... not found checking for posix_memalign() ... found checking for getrandom() ... not found checking for SYS_getrandom in Linux ... found checking for stat.st_atimespec ... not found checking for stat.st_birthtim ... not found checking for stat.st_atim ... found checking for explicit_bzero() ... not found checking for explicit_memset() ... not found checking for PCRE2 library ... not found checking for PCRE library ... not found checking for PCRE library in /usr ... found checking for PCRE version ... 8.32 checking for GNU readline library ... not found checking for editline library in editline/readline.h ... not found checking for editline in edit/readline/readline.h ... not found checking for editline in readline/readline.h ... not found - njs CLI is built without interactive shell support checking for OpenSSL library ... not found checking for OpenSSL library -lcrypto ... found checking for OpenSSL version ... "OpenSSL 1.0.2k-fips 26 Jan 2017" creating build/Makefile checking for expect ... found + Expect version: expect version 5.45 - expect tests are disabled NJS configuration summary: + using CC: "cc" + using CFLAGS: " -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes -Werror -g -O " + using PCRE library: -lpcre + using OpenSSL library: -lcrypto njs build dir: build njs CLI: build/njs | | 王明君 | | wmjhappy_ok at 126.com | On 4/6/2022 09:51,Dmitry Volyntsev wrote: Hi, Please attach the configure output. If njs CLI was built successfully, but the binary does not work in terminal mode. The reason is libreadline was not found during configure phase. On 05.04.2022 16:15, 王明君 wrote: Hi, i'm trying to build only njs command-line utility following _http://nginx.org/en/docs/njs/install.html_, but the final njs does not work as expected. See this mail's attached file to find out how i was trying. *uname -a* Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux *cat os-release* NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" _______________________________________________ nginx mailing list -- nginx at nginx.org To unsubscribe send an email to nginx-leave at nginx.org _______________________________________________ nginx mailing list -- nginx at nginx.org To unsubscribe send an email to nginx-leave at nginx.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From xeioex at nginx.com Wed Apr 6 03:38:39 2022 From: xeioex at nginx.com (Dmitry Volyntsev) Date: Tue, 5 Apr 2022 20:38:39 -0700 Subject: Njs Utility not working In-Reply-To: <122bfc81.3274.17ffc9e2b1e.Coremail.wmjhappy_ok@126.com> References: <7ddac134.29b0.17ffc0345e1.Coremail.wmjhappy_ok@126.com> <8652871f-25a4-4cf4-002b-c8d9a5a1240a@nginx.com> <122bfc81.3274.17ffc9e2b1e.Coremail.wmjhappy_ok@126.com> Message-ID: <79436b4a-8783-243b-4a75-6fa3a627b298@nginx.com> You have to install libreadline for your Linux. I hope the following or similar command should help: sudo yum install readline-devel On 05.04.2022 19:04, 王明君 wrote: > Thanks for helping me. As you reminded, i found this log: > > *checking for GNU readline library ... not found > checking for editline library in editline/readline.h ... not found > checking for editline in edit/readline/readline.h ... not found > checking for editline in readline/readline.h ... not found > - njs CLI is built without interactive shell support* > > So, what can i do to solve this? I'm actually not much experienced > > Full configure output: > ------------------------------------------------- > configuring for Linux 3.10.0-1062.9.1.el7.x86_64 x86_64 > checking for C compiler: cc > + using GNU C compiler > + gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) > checking for sizeof(int) ... 4 > checking for sizeof(u_int) ... 4 > checking for sizeof(void *) ... 8 > checking for sizeof(uintptr_t) ... 8 > checking for sizeof(size_t) ... 8 > checking for sizeof(off_t) ... 8 > checking for sizeof(time_t) ... 8 > checking for system byte ordering ... little > checking for GCC unsigned __int128 ... found > checking for GCC __builtin_expect() ... found > checking for GCC __builtin_unreachable() ... found > checking for GCC __builtin_prefetch() ... found > checking for GCC __builtin_clz() ... found > checking for GCC __builtin_clzll() ... found > checking for GCC __attribute__ visibility ... found > checking for GCC __attribute__ malloc ... found > checking for GCC __attribute__ aligned ... found > checking for GCC __attribute__ packed ... found > checking for Address sanitizer ... not found > checking for Memory sanitizer ... not found > checking for _mm_setcsr() ... found > checking for clock_gettime(CLOCK_MONOTONIC) ... found > checking for struct tm.tm_gmtoff ... found > checking for altzone ... not found > checking for posix_memalign() ... found > checking for getrandom() ... not found > checking for SYS_getrandom in Linux ... found > checking for stat.st_atimespec ... not found > checking for stat.st_birthtim ... not found > checking for stat.st_atim ... found > checking for explicit_bzero() ... not found > checking for explicit_memset() ... not found > checking for PCRE2 library ... not found > checking for PCRE library ... not found > checking for PCRE library in /usr ... found > checking for PCRE version ... 8.32 > checking for GNU readline library ... not found > checking for editline library in editline/readline.h ... not found > checking for editline in edit/readline/readline.h ... not found > checking for editline in readline/readline.h ... not found > - njs CLI is built without interactive shell support > checking for OpenSSL library ... not found > checking for OpenSSL library -lcrypto ... found > checking for OpenSSL version ... "OpenSSL 1.0.2k-fips  26 Jan 2017" > creating build/Makefile > checking for expect ... found > + Expect version: expect version 5.45 > - expect tests are disabled > > NJS configuration summary: > > + using CC: "cc" > + using CFLAGS: " -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra > -Wno-unused-parameter -Wwrite-strings -Wmissing-prototypes -Werror -g -O " > > + using PCRE library: -lpcre > + using OpenSSL library: -lcrypto > > njs build dir: build > njs CLI: build/njs > > > 王明君 > wmjhappy_ok at 126.com > > > > On 4/6/2022 09:51,Dmitry Volyntsev > wrote: > > Hi, > > Please attach the configure output. > > If njs CLI was built successfully, but the binary does not work in > terminal mode. The reason is libreadline was not found during > configure > phase. > > On 05.04.2022 16:15, 王明君 wrote: > > Hi, i'm trying to build only njs command-line utility following > _http://nginx.org/en/docs/njs/install.html_, but the final njs > does > not work as expected. See this mail's attached file to find > out how i > was trying. > > *uname -a* > Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon > Oct 19 > 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux > > *cat os-release* > NAME="CentOS Linux" > VERSION="7 (Core)" > ID="centos" > ID_LIKE="rhel fedora" > VERSION_ID="7" > PRETTY_NAME="CentOS Linux 7 (Core)" > ANSI_COLOR="0;31" > CPE_NAME="cpe:/o:centos:centos:7" > HOME_URL="https://www.centos.org/" > BUG_REPORT_URL="https://bugs.centos.org/" > > CENTOS_MANTISBT_PROJECT="CentOS-7" > CENTOS_MANTISBT_PROJECT_VERSION="7" > REDHAT_SUPPORT_PRODUCT="centos" > REDHAT_SUPPORT_PRODUCT_VERSION="7" > > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org > > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From wmjhappy_ok at 126.com Wed Apr 6 07:02:25 2022 From: wmjhappy_ok at 126.com (=?UTF-8?B?546L5piO5ZCb?=) Date: Wed, 6 Apr 2022 15:02:25 +0800 (GMT+08:00) Subject: Njs - r.variables does not contain variables declared by js_var Message-ID: <3793c1f4.457c.17ffdae7f19.Coremail.wmjhappy_ok@126.com> Hi, sorry to bother again ~ I was trying to access variables declared using js_var but failed. Confused why is that. This is a test demo, but actually i have a massive nginx config file that i want to minify using njs, and under which circumstance i need the js script to have access to variables declared in nginx.conf, either by using js_var directive, or something else (not found). demo - nginx.conf ---------------------------------- http { js_import main from main.js; js_var $abc "ss fd"; server { listen 80; server_name localhost; location / { js_content main.hello; } } } demo - main.js ---------------------------------- function hello(r) { r.headersOut["Content-Type"] = "application/json"; var m = {}; for(var p in r) m[p] = r[p]; m["variables"] = r.variables; r.return(200, JSON.stringify(m)); } export default { hello }; --------------------------------------- demo - output ======================= uname -a Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux cat os-release NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7" | | | | | -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: EE79CD01-959B-4103-AC51-0CF482A91F88.png Type: image/png Size: 7776 bytes Desc: not available URL: From xeioex at nginx.com Wed Apr 6 16:37:38 2022 From: xeioex at nginx.com (Dmitry Volyntsev) Date: Wed, 6 Apr 2022 09:37:38 -0700 Subject: Njs - r.variables does not contain variables declared by js_var In-Reply-To: <3793c1f4.457c.17ffdae7f19.Coremail.wmjhappy_ok@126.com> References: <3793c1f4.457c.17ffdae7f19.Coremail.wmjhappy_ok@126.com> Message-ID: <10577546-2a59-51bb-f5e4-9403854c48e5@nginx.com> Hi, See the following reply on Github https://github.com/nginx/njs/issues/460#issuecomment-1015642606 On 06.04.2022 00:02, 王明君 wrote: > Hi, sorry to bother again ~ > I was trying to access variables declared using js_var but failed. > Confused why is that. > > This is a test demo, but actually i have a massive nginx config file > that i want to minify using njs, and under which circumstance i need > the js script to have access to variables declared in nginx.conf, > either by using js_var directive, or something else (not found). > > *demo - nginx.conf* > ---------------------------------- > http { > js_import main from main.js; > js_var $abc "ss fd"; > > server { > > listen 80; > server_name localhost; > > location / { > > js_content main.hello; > > } > > } > } > > *demo - **main.js* > ---------------------------------- > function hello(r) { >        r.headersOut["Content-Type"] = "application/json"; >        var m = {}; >        for(var p in r) >                m[p] = r[p]; >        m["variables"] = r.variables; >        r.return(200, JSON.stringify(m)); > } > > export default { hello }; > --------------------------------------- > > *demo - **output* > > > > ======================= > > *uname -a* > Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 > 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux > > *cat os-release* > NAME="CentOS Linux" > VERSION="7 (Core)" > ID="centos" > ID_LIKE="rhel fedora" > VERSION_ID="7" > PRETTY_NAME="CentOS Linux 7 (Core)" > ANSI_COLOR="0;31" > CPE_NAME="cpe:/o:centos:centos:7" > HOME_URL="https://www.centos.org/" > BUG_REPORT_URL="https://bugs.centos.org/" > > CENTOS_MANTISBT_PROJECT="CentOS-7" > CENTOS_MANTISBT_PROJECT_VERSION="7" > REDHAT_SUPPORT_PRODUCT="centos" > REDHAT_SUPPORT_PRODUCT_VERSION="7" > > > > > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From parakrama1282 at gmail.com Fri Apr 8 12:14:08 2022 From: parakrama1282 at gmail.com (Dhanushka Parakrama) Date: Fri, 8 Apr 2022 17:44:08 +0530 Subject: Nginx 404 redirection to error page Message-ID: Hi All I have simple drupal site running and i wanted to redirect 404 pages to a error page , So i have following configuration in place error_page 404 https://example.com/page-not-found; when it try to access non existing page such as https://example.com/abc , then from nginx page correctly get redirect to the *https://example.com/page-not-found * But when i try to access non non-existing page ( with extension ) such as https://example.com/*abc.js * it does not get redirected to the *https://example.com/page-not-found *page . So is there any way to fix this issue? , please advice Thank You -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis at daoine.org Sat Apr 9 06:30:07 2022 From: francis at daoine.org (Francis Daly) Date: Sat, 9 Apr 2022 07:30:07 +0100 Subject: Nginx 404 redirection to error page In-Reply-To: References: Message-ID: <20220409063007.GT14624@daoine.org> On Fri, Apr 08, 2022 at 05:44:08PM +0530, Dhanushka Parakrama wrote: Hi there, > when it try to access non existing page such as https://example.com/abc > , then from nginx page correctly get redirect to the > *https://example.com/page-not-found > But when i try to access non non-existing page ( with extension ) such as > https://example.com/*abc.js * it does not get redirected to the > *https://example.com/page-not-found What is your config? As in: * in which location{} is the request /abc.js handled? What is the error_page directive there, and what handler ("something_pass" directive, usually) is there? * in which location{} is the request /abc handled? What is the error_page directive there, and what handler ("something_pass" directive, usually) is there? > So is there any way to fix this issue? , please advice Maybe "fastcgi_intercept_errors on;" will help, if you are using fastcgi_pass. http://nginx.org/r/fastcgi_intercept_errors Cheers, f -- Francis Daly francis at daoine.org From francis at daoine.org Sat Apr 9 06:52:30 2022 From: francis at daoine.org (Francis Daly) Date: Sat, 9 Apr 2022 07:52:30 +0100 Subject: Feature request to "access_log" directive In-Reply-To: References: Message-ID: <20220409065230.GU14624@daoine.org> On Mon, Apr 04, 2022 at 04:28:54PM -0300, Fabiano Furtado Pessoa Coelho wrote: Hi there, > Sorry to bother you with this feature request. I believe you software > engineers already thought about it and there are a million reasons to > not implement it. I suspect that what you are asking for probably breaks the current nginx processing and logging model, and would probably require significant code changes. You are welcome to submit a patch for it -- after either having written one, or incentivised someone to write one for you -- and it will presumably be considered for inclusion in the stock nginx code. (And if it isn't included in stock, you can always use it in your version.) But you may find there is a simpler way to achieve your desired end result. > Well, I'm exactly in this situation described here > https://serverfault.com/questions/498799/how-to-log-nginx-requests-made-to-a-specific-location-in-a-different-file > I want to use "try_files" and log the access within the location with > "try_files" directive... As you probably know, that will do what you say you want if the file $document_root$uri is present, and not otherwise. > location /my_system { > access_log /var/log/nginx/my_system_access.log; > try_files $uri @named_loc; > } > location @named_loc { > access_log off; > proxy_pass http://...; > } > > ... and I can't! "Requests are logged in the context of a location > where processing ends. It may be different from the original location, > if an internal redirect happens during request processing." > I can make it work using the "#include" directive and removing the > named location, but using "try_files" is more clean and sophisticated. As you say, you can change the config to match what nginx does to what you want. Alternatively, you could possibly post-process the log files to end up with what you want -- either read the old log files and split the contents according to what you want; or maybe have nginx write to a stream, and have your own processor reading that stream and writing each log entry to your desired place for it. > Is there a way to include the "now" directive to "access_log"? > Something like: "access_log /var/log/nginx/my_system_access.log now;" I suspect: only if you provide the code to do so. Cheers, f -- Francis Daly francis at daoine.org From fusca14 at gmail.com Mon Apr 11 13:02:40 2022 From: fusca14 at gmail.com (Fabiano Furtado Pessoa Coelho) Date: Mon, 11 Apr 2022 10:02:40 -0300 Subject: Feature request to "access_log" directive In-Reply-To: <20220409065230.GU14624@daoine.org> References: <20220409065230.GU14624@daoine.org> Message-ID: Hi, Francis. Thanks for the reply. I'm gonna try to implement this feature, but I think it will be hard for me. For now, I'll change the NGINX configuration files to use access_log according to my needs. I've one more question about an access_log weird behavior, when it's configured with a $1 regex return variable. For instance: location ~ ^/(system1|system2) { access_log /var/log/nginx/$1_access.log; proxy_pass ...; } The only way NGINX can write to system1_access.log and system2_access.log files is when they exist in the specified directory. Otherwise, the log isn't computed. I think creating them at the moment of system start is impossible because the $1 variable isn't initialized yet, but why can't NGINX automatically create them at the moment they are used? Thanks again. Fabiano On Sat, Apr 9, 2022 at 3:55 AM Francis Daly wrote: > > On Mon, Apr 04, 2022 at 04:28:54PM -0300, Fabiano Furtado Pessoa Coelho wrote: > > Hi there, > > > Sorry to bother you with this feature request. I believe you software > > engineers already thought about it and there are a million reasons to > > not implement it. > > I suspect that what you are asking for probably breaks the current nginx > processing and logging model, and would probably require significant > code changes. > > You are welcome to submit a patch for it -- after either having written > one, or incentivised someone to write one for you -- and it will > presumably be considered for inclusion in the stock nginx code. > > (And if it isn't included in stock, you can always use it in your > version.) > > But you may find there is a simpler way to achieve your desired end > result. > > > Well, I'm exactly in this situation described here > > https://serverfault.com/questions/498799/how-to-log-nginx-requests-made-to-a-specific-location-in-a-different-file > > I want to use "try_files" and log the access within the location with > > "try_files" directive... > > As you probably know, that will do what you say you want if the file > $document_root$uri is present, and not otherwise. > > > location /my_system { > > access_log /var/log/nginx/my_system_access.log; > > try_files $uri @named_loc; > > } > > location @named_loc { > > access_log off; > > proxy_pass http://...; > > } > > > > ... and I can't! "Requests are logged in the context of a location > > where processing ends. It may be different from the original location, > > if an internal redirect happens during request processing." > > I can make it work using the "#include" directive and removing the > > named location, but using "try_files" is more clean and sophisticated. > > As you say, you can change the config to match what nginx does to what > you want. > > Alternatively, you could possibly post-process the log files to end up > with what you want -- either read the old log files and split the contents > according to what you want; or maybe have nginx write to a stream, and > have your own processor reading that stream and writing each log entry > to your desired place for it. > > > Is there a way to include the "now" directive to "access_log"? > > Something like: "access_log /var/log/nginx/my_system_access.log now;" > > I suspect: only if you provide the code to do so. > > Cheers, > > f > -- > Francis Daly francis at daoine.org > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From nginx-forum at forum.nginx.org Mon Apr 11 16:52:02 2022 From: nginx-forum at forum.nginx.org (dimitre) Date: Mon, 11 Apr 2022 12:52:02 -0400 Subject: Nginx development Message-ID: <0982e0f932e326334977c44d17ad5915.NginxMailingListEnglish@forum.nginx.org> First of all thanks for all the hard work on the best server out there. I'm now using the experimental QUIC branch. I've noticed developent stalled about two months ago, both QUIC and mainline. As I knew about Igor departure this year I'm kind of curious if the project still have a roadmap, if QUIC will eventually be merged into mainline. Thank you Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293924,293924#msg-293924 From nginx-forum at forum.nginx.org Tue Apr 12 09:16:04 2022 From: nginx-forum at forum.nginx.org (gperrot) Date: Tue, 12 Apr 2022 05:16:04 -0400 Subject: map problem : how to debug it ? Message-ID: Hello, I am using nginx/1.16.1 on CentOS Linux 7. I am using map directive for managing a large number of redirects from one server to another server : map $request_uri $new_uri { include /etc/nginx/conf/redirect.map; include /etc/nginx/conf/documentation.map; } In /etc/nginx/conf/documentation.map, I have 1200 redirections like those below (the first one works, the second one doesn't). '/Documentation/Security.html#External' 'https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication'; '/Documentation/Helpers.html#AppHelpers' 'https://support.communigate.com/en/guides/communigate-pro-manual/applications/helper-applications/external-application-helpers;' If I try to use https://communigate.com/documentation/Helpers.html#AppHelpers (first redirection), I have "page not found (404)" and the logs are : 162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET /documentation//Helpers.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" 162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET /documentation/Helpers.html HTTP/2.0" 404 45842 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" If I try to use https://communigate.com/documentation//Security.html#External (second redirection), I have the page and the logs are : 141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET /documentation//Security.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" 141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET /documentation/Security.html HTTP/2.0" 301 162 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" If I try to access from my nginx server to the destination URL https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication or I have tested there is no synthax error in my configuration file with : # nginx -c /etc/nginx/nginx.conf -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful I also tried systemctl reload/restart nginx without results. Do you know how can I debug that ? Is there a way to check what are the requests done to destination host by my nginx server ? Thanks in advance for your help. Gilles Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293930,293930#msg-293930 From francis at daoine.org Tue Apr 12 11:19:28 2022 From: francis at daoine.org (Francis Daly) Date: Tue, 12 Apr 2022 12:19:28 +0100 Subject: Feature request to "access_log" directive In-Reply-To: References: <20220409065230.GU14624@daoine.org> Message-ID: <20220412111928.GV14624@daoine.org> On Mon, Apr 11, 2022 at 10:02:40AM -0300, Fabiano Furtado Pessoa Coelho wrote: Hi there, > I've one more question about an access_log weird behavior, when it's > configured with a $1 regex return variable. http://nginx.org/r/access_log -- The file path can contain variables > For instance: > > location ~ ^/(system1|system2) { > access_log /var/log/nginx/$1_access.log; > proxy_pass ...; > } > > The only way NGINX can write to system1_access.log and > system2_access.log files is when they exist in the specified > directory. Otherwise, the log isn't computed. My guess is that """ the user whose credentials are used by worker processes should have permissions to create files in a directory with such logs; """ is not the case. $ ls -ld /var/log/nginx/ $ ls -l /var/log/nginx/system1_access.log might show the users and permissions involved. Good luck with it, f -- Francis Daly francis at daoine.org From maxim at nginx.com Tue Apr 12 12:13:58 2022 From: maxim at nginx.com (Maxim Konovalov) Date: Tue, 12 Apr 2022 15:13:58 +0300 Subject: Nginx development In-Reply-To: <0982e0f932e326334977c44d17ad5915.NginxMailingListEnglish@forum.nginx.org> References: <0982e0f932e326334977c44d17ad5915.NginxMailingListEnglish@forum.nginx.org> Message-ID: Hi Dimitre, On 11.04.2022 19:52, dimitre wrote: > First of all thanks for all the hard work on the best server out there. > I'm now using the experimental QUIC branch. I've noticed developent stalled > about two months ago, both QUIC and mainline. > As I knew about Igor departure this year I'm kind of curious if the project > still have a roadmap, if QUIC will eventually be merged into mainline. > Thank you > Indeed, we are busy with some internal re-grouping now. This is not related to Igor's departure. However, neither nginx or http/3 development are abandoned. We are planning to have new mainline cut off somewhere in May. Maxim -- Maxim Konovalov From osa at freebsd.org.ru Tue Apr 12 12:32:17 2022 From: osa at freebsd.org.ru (Sergey A. Osokin) Date: Tue, 12 Apr 2022 15:32:17 +0300 Subject: map problem : how to debug it ? In-Reply-To: References: Message-ID: Hi, hope you're doing well these days. The best way to debug such situations is to enable a debugging log [1]. Hope that helps. While I'm here I'd recommend to upgrade nginx instance to the more recent stable version, i.e. 1.20.2. References: [1] https://nginx.org/en/docs/debugging_log.html -- Sergey A. Osokin On Tue, Apr 12, 2022 at 05:16:04AM -0400, gperrot wrote: > Hello, > > I am using nginx/1.16.1 on CentOS Linux 7. I am using map directive for > managing a large number of redirects from one server to another server : > > map $request_uri $new_uri { > include /etc/nginx/conf/redirect.map; > include /etc/nginx/conf/documentation.map; > } > > In /etc/nginx/conf/documentation.map, I have 1200 redirections like those > below (the first one works, the second one doesn't). > > '/Documentation/Security.html#External' > 'https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication'; > '/Documentation/Helpers.html#AppHelpers' > 'https://support.communigate.com/en/guides/communigate-pro-manual/applications/helper-applications/external-application-helpers;' > > If I try to use > https://communigate.com/documentation/Helpers.html#AppHelpers (first > redirection), I have "page not found (404)" and the logs are : > > 162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET > /documentation//Helpers.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > 162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET > /documentation/Helpers.html HTTP/2.0" 404 45842 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > > If I try to use > https://communigate.com/documentation//Security.html#External (second > redirection), I have the page and the logs are : > > 141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET > /documentation//Security.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > 141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET > /documentation/Security.html HTTP/2.0" 301 162 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > > If I try to access from my nginx server to the destination URL > https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication > or > > I have tested there is no synthax error in my configuration file with : > > # nginx -c /etc/nginx/nginx.conf -t > nginx: the configuration file /etc/nginx/nginx.conf syntax is ok > nginx: configuration file /etc/nginx/nginx.conf test is successful > > I also tried systemctl reload/restart nginx without results. > > Do you know how can I debug that ? Is there a way to check what are the > requests done to destination host by my nginx server ? > > Thanks in advance for your help. > > Gilles From iippolitov at nginx.com Tue Apr 12 13:44:35 2022 From: iippolitov at nginx.com (Igor Ippolitov) Date: Tue, 12 Apr 2022 14:44:35 +0100 Subject: map problem : how to debug it ? In-Reply-To: References: Message-ID: Hello Gilles, A browser won't send URL postion after the '#' mark to a web server. So your maps won't work as expected and there is nothing to do in Nginx about it. Regards, Igor. On 12.04.2022 10:16, gperrot wrote: > Hello, > > I am using nginx/1.16.1 on CentOS Linux 7. I am using map directive for > managing a large number of redirects from one server to another server : > > map $request_uri $new_uri { > include /etc/nginx/conf/redirect.map; > include /etc/nginx/conf/documentation.map; > } > > In /etc/nginx/conf/documentation.map, I have 1200 redirections like those > below (the first one works, the second one doesn't). > > '/Documentation/Security.html#External' > 'https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication'; > '/Documentation/Helpers.html#AppHelpers' > 'https://support.communigate.com/en/guides/communigate-pro-manual/applications/helper-applications/external-application-helpers;' > > If I try to use > https://communigate.com/documentation/Helpers.html#AppHelpers (first > redirection), I have "page not found (404)" and the logs are : > > 162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET > /documentation//Helpers.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > 162.158.50.134 - - [12/Apr/2022:07:48:17 +0000] "GET > /documentation/Helpers.html HTTP/2.0" 404 45842 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > > If I try to use > https://communigate.com/documentation//Security.html#External (second > redirection), I have the page and the logs are : > > 141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET > /documentation//Security.html HTTP/2.0" 301 0 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > 141.101.68.139 - - [12/Apr/2022:07:50:26 +0000] "GET > /documentation/Security.html HTTP/2.0" 301 162 "-" "Mozilla/5.0 (X11; Linux > x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 > Safari/537.36" > > If I try to access from my nginx server to the destination URL > https://support.communigate.com/en/guides/communigate-pro-manual/system-administration/security-2/external-authentication > or > > I have tested there is no synthax error in my configuration file with : > > # nginx -c /etc/nginx/nginx.conf -t > nginx: the configuration file /etc/nginx/nginx.conf syntax is ok > nginx: configuration file /etc/nginx/nginx.conf test is successful > > I also tried systemctl reload/restart nginx without results. > > Do you know how can I debug that ? Is there a way to check what are the > requests done to destination host by my nginx server ? > > Thanks in advance for your help. > > Gilles > > Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293930,293930#msg-293930 > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From fusca14 at gmail.com Tue Apr 12 14:51:13 2022 From: fusca14 at gmail.com (Fabiano Furtado Pessoa Coelho) Date: Tue, 12 Apr 2022 11:51:13 -0300 Subject: Feature request to "access_log" directive In-Reply-To: <20220412111928.GV14624@daoine.org> References: <20220409065230.GU14624@daoine.org> <20220412111928.GV14624@daoine.org> Message-ID: Thank you very much, Francis! Indeed, it was a permission issue on the filesystem. Again, my bad! Sorry to bother this mailing list with this basic issue. On Tue, Apr 12, 2022 at 8:22 AM Francis Daly wrote: > > On Mon, Apr 11, 2022 at 10:02:40AM -0300, Fabiano Furtado Pessoa Coelho wrote: > > Hi there, > > > I've one more question about an access_log weird behavior, when it's > > configured with a $1 regex return variable. > > http://nginx.org/r/access_log -- The file path can contain variables > > > For instance: > > > > location ~ ^/(system1|system2) { > > access_log /var/log/nginx/$1_access.log; > > proxy_pass ...; > > } > > > > The only way NGINX can write to system1_access.log and > > system2_access.log files is when they exist in the specified > > directory. Otherwise, the log isn't computed. > > My guess is that > > """ > the user whose credentials are used by worker processes should have > permissions to create files in a directory with such logs; > """ > > is not the case. > > $ ls -ld /var/log/nginx/ > $ ls -l /var/log/nginx/system1_access.log > > might show the users and permissions involved. > > Good luck with it, > > f > -- > Francis Daly francis at daoine.org > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From scott.snow at zoll.com Tue Apr 12 15:29:57 2022 From: scott.snow at zoll.com (Scott Snow) Date: Tue, 12 Apr 2022 15:29:57 +0000 Subject: Format of messages posted to error_log? Message-ID: Is there documentation for the format of error messages nginx posted to error_log? Specifically, following the level in square brackets are two numbers separated by '#'; what do these represent? For instance, the message on the page Advanced Configuration with Snippets | NGINX Ingress Controller begins with "[emerg] 31:31:" Why I'm asking is for purposes of documentation; a system using nginx routes these messages to syslog; the design document for the module responsible for publishing the messages gives the format and examples. The example for nginx errors begins: <131>Oct 24 18:17:47 imx7d-zoll-resus nginx: 2018/10/24 18:17:47 [error] 3105#0: *11 connect() failed (111: Connection refused) while connecting ... We have a format and examples for each of syslog-ng, gunicorn access, gunicorn error, and nginx access. -------------- next part -------------- An HTML attachment was scrubbed... URL: From osa at freebsd.org.ru Tue Apr 12 16:03:58 2022 From: osa at freebsd.org.ru (Sergey A. Osokin) Date: Tue, 12 Apr 2022 19:03:58 +0300 Subject: Format of messages posted to error_log? Message-ID: Hi Scott, hope you're doing well. The error_log directive is documented well [1]. There's no format of error messages. While I'm here I'd recommend to keep 72 characters per line, that helps a lot to read emails, thank you. References: [1] https://nginx.org/en/docs/ngx_core_module.html#error_log -- Sergey A. Osokin In-Reply-To: On Tue, Apr 12, 2022 at 03:29:57PM +0000, Scott Snow wrote: > Is there documentation for the format of error messages nginx posted to error_log? > Specifically, following the level in square brackets are two numbers separated by '#'; what do these represent? > For instance, the message on the page Advanced Configuration with Snippets | NGINX Ingress Controller begins with "[emerg] 31:31:" > Why I'm asking is for purposes of documentation; a system using nginx routes these messages to syslog; the design document for the module responsible for publishing the messages gives the format and examples. The example for nginx errors begins: > <131>Oct 24 18:17:47 imx7d-zoll-resus nginx: 2018/10/24 18:17:47 [error] 3105#0: *11 connect() failed (111: Connection refused) while connecting ... > > We have a format and examples for each of syslog-ng, gunicorn access, gunicorn error, and nginx access. From scott.snow at zoll.com Tue Apr 12 17:04:19 2022 From: scott.snow at zoll.com (Scott Snow) Date: Tue, 12 Apr 2022 17:04:19 +0000 Subject: Format of messages posted to error_log? In-Reply-To: References: Message-ID: Sergey - Thanks for the quick reply. Note I am not asking after format of message content akin to what's available for access_log, just the interpretation of the numerical parts of the apparent pattern in the error_log messages posted: "[] # : " Perhaps you mean even the "[] #" isn't fixed or necessarily present; in that case, is there something distinguishing error_log entries that do not follow this pattern? -------------- next part -------------- An HTML attachment was scrubbed... URL: From xeioex at nginx.com Tue Apr 12 17:18:59 2022 From: xeioex at nginx.com (Dmitry Volyntsev) Date: Tue, 12 Apr 2022 10:18:59 -0700 Subject: njs-0.7.3 Message-ID: <4f4feb22-e1ee-a678-4e9a-a0d42f1a7760@nginx.com> Hello, I'm glad to announce a new release of NGINX JavaScript module (njs). This release focuses on stabilization of recently released features including async/await and fixing bugs found by various fuzzers. Learn more about njs: - Overview and introduction:https://nginx.org/en/docs/njs/ - NGINX JavaScript in Your Web Server Configuration: https://youtu.be/Jc_L6UffFOs - Extending NGINX with Custom Code:https://youtu.be/0CVhq4AUU7M - Using node modules with njs: https://nginx.org/en/docs/njs/node_modules.html - Writing njs code using TypeScript definition files: https://nginx.org/en/docs/njs/typescript.html We are hiring: If you are a C programmer, passionate about Open Source and you love what we do, consider the following career opportunity: https://ffive.wd5.myworkdayjobs.com/NGINX/job/Ireland-Homebase/Software-Engineer-III---NGNIX-NJS_RP1022237 Feel free to try it and give us feedback on: - Github:https://github.com/nginx/njs/issues - Mailing list:https://mailman.nginx.org/mailman/listinfo/nginx-devel Changes with njs 0.7.3 12 Apr 2022 Core: *) Feature: added support of module resolution callback. This feature allows a host environment to control how imported modules are loaded. *) Bugfix: fixed backtraces while traversing imported user modules. *) Bugfix: fixed Array.prototype.concat() when "this" is a slow array. *) Bugfix: fixed frame allocation from an awaited frame. *) Bugfix: fixed allocation of large array literals. *) Bugfix: fixed interpreter when "toString" conversion fails. -------------- next part -------------- An HTML attachment was scrubbed... URL: From x at mediatrue.org Tue Apr 12 18:12:12 2022 From: x at mediatrue.org (x at mediatrue.org) Date: Tue, 12 Apr 2022 21:12:12 +0300 Subject: =?UTF-8?Q?=D0=91=D0=B5=D0=B7_=D0=B0=D0=B1=D1=81=D0=BE=D0=BB?= =?UTF-8?Q?=D1=8E=D1=82=D0=BD=D0=BE=D0=B9_=D0=B8=D1=81=D1=82=D0=B8=D0=BD?= =?UTF-8?Q?=D1=8B_=D0=B8_=D0=BD=D0=B0=D0=B8=D0=B2=D1=8B=D1=81=D1=88=D0=B5?= =?UTF-8?Q?=D0=B9_=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B5=D0=B4=D0=BB=D0=B8?= =?UTF-8?Q?=D0=B2=D0=BE=D1=81=D1=82=D0=B8=3A_=D0=BD=D0=B0=D1=88=D0=B5_?= =?UTF-8?Q?=D0=BC=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5_-_=D0=BD=D0=B8=D1=87=D0=B5?= =?UTF-8?Q?=D0=B3=D0=BE_=D0=BD=D0=B5_=D0=B7=D0=BD=D0=B0=D1=87=D0=B8=D1=82?= In-Reply-To: <704089d630fce15014205aa1791aba9d@mediatrue.org> References: <42EA6858-C4E7-4504-9475-49E1EBD6E90D@mediatrue.org> <2C3F7C93-96C8-44E1-9CBA-A658960971EB@mediatrue.org> <450370c8b75615fa133b8daff7a1fd22@mediatrue.org> <0a00040bd8da15640aba21a00a2838cc@mediatrue.org> <6e3f95981a961b24d9fe66f78b655874@mediatrue.org> <9d62fb267f187ad17a8d1e0a665d7b0c@mediatrue.org> <2724d801552c391e24bdc5670c6f560e@mediatrue.org> <1549a29f2f83b4825f0e2928c340e30f@mediatrue.org> <0873c8f86eeb206ee9b39d0fdadd3e4f@mediatrue.org> <6087946ff85b487fba0dc808e1e5923a@mediatrue.org> <795212219002102d32d44789c221dfdb@mediatrue.org> <80143e5ceb6eb3d2f1b308291b924184@mediatrue.org> <544f74b61522396df156f9dc1e918c9b@mediatrue.org> <02344f1aa0ccb170306b8ee6da2fd7af@mediatrue.org> <0cb858da9207c7cfd38551e1b576d73b@mediatrue.org> <1f6f72906b7eb52091cc79d5ab70ceab@mediatrue.org> <8236d6b4c13de5db4bf0fd40cec18464@mediatrue.org> <33d554321e4400669cbf66ec643d6c2d@mediatrue.org> <136be4e620edd616e8bc8b44bb28dbfe@mediatrue.org> <7c2fbc65a25c6c7cafbf30be3b47f3cd@mediatrue.org> <588338cb95ba5138af40fa1d782ffc0c@mediatrue.org> <98d7b53b863b221aba52d7da46e94ada@mediatrue.org> <529cec8685c527dab25cf58f0c88a97a@mediatrue.org> <0468af82dca7aa98d7fe5a0a13821e14@mediatrue.org> <5982f83851d70ddfdc6e0972c8f979ab@mediatrue.org> <1a99f01c84854fbea2c11d1725126090@mediatrue.org> <5a5f832e39d8ed83a8749768a4cde321@mediatrue.org> <71449d71dd9c4fe780034598cf890647@mediatrue.org> <136d85a38d474260c1e44c5e63630879@mediatrue.org> <9dd76435517b1c4fef157171d98b5312@mediatrue.org> <1506ce99a3917af96672c72677d954f1@mediatrue.org> <3aabc5690d9410fb7ce0f50220513875@mediatrue.org> <7c937297361dec76f26a62b7e8a9dd2d@mediatrue.org> <465adc6083b0f604b9bdbcae15c6c594@mediatrue.org> <267c4b2d0535e6b93f082c35bfef8a2e@mediatrue.org> <1b865a1eec656a7426f57bda9b3f6e67@mediatrue.org> <2ad4b9df41485970d7fd7198ea459f5e@mediatrue.org> <5cf3f56b5a1f09e5df29c2b789c72cca@mediatrue.org> <2a7b17943a6d4ad3b0dcab842c972038@mediatrue.org> <3f0029a9e286a716c3eda62dd8c700ad@mediatrue.org> <16bb55870f2bd6d751f4bab8a00f5b3c@mediatrue.org> <1b36fa97dd08c6781f52d93728b2fccd@mediatrue.org> <29e0c2c76925eed08bc5849c5818cc95@mediatrue.org> <1384eb4c32690ee955610ba2eb06390c@mediatrue.org> <98f6ce1815732bc0c1647135fccef9e3@mediatrue.org> <9a7b73b2c25c3409f3469b806eab4e79@mediatrue.org> <96acef50ec06b973e2ccf96584edbd53@mediatrue.org> <704089d630fce15014205aa1791aba9d@mediatrue.org> Message-ID: Помня о убитом за христианскую миссию священнике Данииле Сысоеве, пишу вам. Что американцы провозгласили свою победу во "второй мировой" смертью, начавшейся с испытаний атомной бомбы, под названием ГАДЖЕТ, не забыли ? А неорганическая физика и ее детерминизм, это и есть смерть органики: а значит, физическая геополитика, и система глобального контроля,доверяющих ей: То, как освобождать верующих в Бога людей, от детерминизма ваших и их атомно-электронных сетей, подчиняющих их и ссылающихся друг на друга ? В прилагаемом pdf, описание проблемы. Памятка о нарушении прав Бога(ведь для верующих, он важнее) здесь: godrights.online С уважением, Татьяна и Владимир Васильевы. +79052225200 -------------- next part -------------- A non-text attachment was scrubbed... Name: smartconflict.pdf Type: application/pdf Size: 175619 bytes Desc: not available URL: From osa at freebsd.org.ru Tue Apr 12 19:30:29 2022 From: osa at freebsd.org.ru (Sergey A. Osokin) Date: Tue, 12 Apr 2022 22:30:29 +0300 Subject: Format of messages posted to error_log? In-Reply-To: References: Message-ID: On Tue, Apr 12, 2022 at 05:04:19PM +0000, Scott Snow wrote: > Sergey - > Thanks for the quick reply. > > Note I am not asking after format of message content akin to what's > available for access_log, just the interpretation of the numerical parts > of the apparent pattern in the error_log messages posted: > "[] # : " > > Perhaps you mean even the "[] #" isn't fixed > or necessarily present; in that case, is there something distinguishing > error_log entries that do not follow this pattern? Well, those two numbers are processId#connectionId, please visit the following link to get more details: https://nginx.org/en/docs/dev/development_guide.html#logging -- Sergey A. Osokin From oleg at mamontov.net Wed Apr 13 06:33:31 2022 From: oleg at mamontov.net (Oleg A. Mamontov) Date: Wed, 13 Apr 2022 09:33:31 +0300 Subject: Format of messages posted to error_log? In-Reply-To: References: Message-ID: <20220413063331.wy257pso62p254s7@xenon.mamontov.net> On Tue, Apr 12, 2022 at 10:30:29PM +0300, Sergey A. Osokin wrote: >On Tue, Apr 12, 2022 at 05:04:19PM +0000, Scott Snow wrote: >> Sergey - >> Thanks for the quick reply. >> >> Note I am not asking after format of message content akin to what's >> available for access_log, just the interpretation of the numerical parts >> of the apparent pattern in the error_log messages posted: >> "[] # : " >> >> Perhaps you mean even the "[] #" isn't fixed >> or necessarily present; in that case, is there something distinguishing >> error_log entries that do not follow this pattern? > >Well, those two numbers are processId#connectionId, please visit the >following link to get more details: Please let me correct a little: "processId#threadId: *connectionId" >https://nginx.org/en/docs/dev/development_guide.html#logging > >-- >Sergey A. Osokin >_______________________________________________ >nginx mailing list -- nginx at nginx.org >To unsubscribe send an email to nginx-leave at nginx.org -- Cheers, Oleg A. Mamontov From nginx-forum at forum.nginx.org Wed Apr 13 09:41:53 2022 From: nginx-forum at forum.nginx.org (gperrot) Date: Wed, 13 Apr 2022 05:41:53 -0400 Subject: map problem : how to debug it ? In-Reply-To: References: Message-ID: <853730d689367f49173eec8e83c38124.NginxMailingListEnglish@forum.nginx.org> Thanks a lot for all your answers ! Since I have the case below with anchor (fragment-ID in URL to map to one specific action in my doc.map : /Doc.html#case1 https://domain2.com/action1; /Doc.html#case2 https://domain2.com/action2; /Doc.html https://domain2.com/action3; How can I do this kind of mapping with Nginx ? For the moment, my conf is : map $uri $new_uri { include /etc/nginx/conf/doc.map; } If I type https://domain1.com/Doc.html, the map for action3 works but if I type https://domain1.com/Doc.html#case1 or https://domain1.com/Doc.html#case2, the map doesn't work. Any idea how to solve that ? Thanks in advance for your help. Gilles Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293930,293948#msg-293948 From iippolitov at nginx.com Wed Apr 13 10:45:15 2022 From: iippolitov at nginx.com (Igor Ippolitov) Date: Wed, 13 Apr 2022 11:45:15 +0100 Subject: map problem : how to debug it ? In-Reply-To: <853730d689367f49173eec8e83c38124.NginxMailingListEnglish@forum.nginx.org> References: <853730d689367f49173eec8e83c38124.NginxMailingListEnglish@forum.nginx.org> Message-ID: Gilles, When you enter a url with an anchor into a browser, the browser will only request a URL without the anchor from the web server. The web servers gets only the part you see in logs. For '/Doc.html#case1' the web server will receive a request for '/Doc.html'. The anchor is used by the browser itself to navigate within a page. You can't rely on the anchor part to make decisions on the web server side. AFAIK, the anchors were initially to scroll to a an element with a corresponding ID. Later it was reused by JS frameworks to build navigation within so called single page applications. This link may help: https://en.wikipedia.org/wiki/Single-page_application#Browser_history (note that it also uses an anchor ;) To sum it up: there is no solution to the problem you are asking about. But most likely this is an XY problem: https://en.wikipedia.org/wiki/XY_problem . Hope this helps, Igor. On 13.04.2022 10:41, gperrot wrote: > Thanks a lot for all your answers ! > > Since I have the case below with anchor (fragment-ID in URL to map to one > specific action in my doc.map : > > /Doc.html#case1 https://domain2.com/action1; > /Doc.html#case2 https://domain2.com/action2; > /Doc.html https://domain2.com/action3; > > How can I do this kind of mapping with Nginx ? > > For the moment, my conf is : > map $uri $new_uri { > include /etc/nginx/conf/doc.map; > } > > If I type https://domain1.com/Doc.html, the map for action3 works but if I > type https://domain1.com/Doc.html#case1 or > https://domain1.com/Doc.html#case2, the map doesn't work. > > Any idea how to solve that ? > > Thanks in advance for your help. > > Gilles > > Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293930,293948#msg-293948 > > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org From nginx-forum at forum.nginx.org Wed Apr 13 11:43:48 2022 From: nginx-forum at forum.nginx.org (arx) Date: Wed, 13 Apr 2022 07:43:48 -0400 Subject: reverse proxy with dns control Message-ID: <9a7351543792ea659ac0e33abecb50c8.NginxMailingListEnglish@forum.nginx.org> Hi guys, for security problems on my server, I should create a reverse proxy that allows only those who use the dns provided by me to be able to pass. practically I make a list with the incoming dns and I pass only those to my main server behind the reverse. is it possible to do this? thank you all Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293951,293951#msg-293951 From nginx-forum at forum.nginx.org Wed Apr 13 12:07:03 2022 From: nginx-forum at forum.nginx.org (gperrot) Date: Wed, 13 Apr 2022 08:07:03 -0400 Subject: map problem : how to debug it ? In-Reply-To: References: Message-ID: Hello Igor, Thanks a lot for your complete answer. So if I well understood, no way to make a nginx redirection based on #anchor passed in URL ? No workaround possible ? We have a code including help link which contains anchors, code we can change easily since many users have it. Thanks in advance for your help. Gilles Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293930,293952#msg-293952 From nginx-forum at forum.nginx.org Thu Apr 14 10:33:48 2022 From: nginx-forum at forum.nginx.org (arx) Date: Thu, 14 Apr 2022 06:33:48 -0400 Subject: reverse proxy with dns control In-Reply-To: <9a7351543792ea659ac0e33abecb50c8.NginxMailingListEnglish@forum.nginx.org> References: <9a7351543792ea659ac0e33abecb50c8.NginxMailingListEnglish@forum.nginx.org> Message-ID: <89ec6aaec0c1f6fca308666a690ce7c7.NginxMailingListEnglish@forum.nginx.org> like something like that server { listen port; location / { if ($http_host ~ "dnsinput:port") { proxy_buffering off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass dnsoutput:port; } } } it gives me syntax error I get the input from the file GET /favicon.ico HTTP/1.1" 404 548 "http://dnsinput:port/" in access.log Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293951,293956#msg-293956 From francis at daoine.org Thu Apr 14 10:46:58 2022 From: francis at daoine.org (Francis Daly) Date: Thu, 14 Apr 2022 11:46:58 +0100 Subject: reverse proxy with dns control In-Reply-To: <9a7351543792ea659ac0e33abecb50c8.NginxMailingListEnglish@forum.nginx.org> References: <9a7351543792ea659ac0e33abecb50c8.NginxMailingListEnglish@forum.nginx.org> Message-ID: <20220414104658.GW14624@daoine.org> On Wed, Apr 13, 2022 at 07:43:48AM -0400, arx wrote: Hi there, > for security problems on my server, I should create a reverse proxy that > allows only those who use the dns provided by me to be able to pass. > practically I make a list with the incoming dns and I pass only those to my > main server behind the reverse. > is it possible to do this? I think you might be looking for two server{} blocks; one with "listen port default_server" that will not talk to the backend; and one with "listen port" without "default_server", and with "server_name" with the names that you want, that will talk to the back-end service. See, for example, http://nginx.org/en/docs/http/server_names.html#miscellaneous_names where using the config either side of "In catch-all server examples", requests for four names to port 80 will be handled in one server{} block, and requests for any other names to port 80 will be handled in the other server{} block. Cheers, f -- Francis Daly francis at daoine.org From nginx-forum at forum.nginx.org Thu Apr 14 11:02:28 2022 From: nginx-forum at forum.nginx.org (arx) Date: Thu, 14 Apr 2022 07:02:28 -0400 Subject: reverse proxy with dns control In-Reply-To: <20220414104658.GW14624@daoine.org> References: <20220414104658.GW14624@daoine.org> Message-ID: the important thing for me is the dns, the port is static and no server do the check, the problem that I don't know how it is calls the variable with what name the client makes the request (the dns that is invoked in the GET method by the client) present in access.log [14/Apr/2022:12:22:57 +0200] "GET /favicon.ico HTTP/1.1" 404 548 "http://DNS:PORT/" "Mozilla/5.0 (........ I have to check on dns, and when I go to put the condition (as in the previous example it gives me a syntax error) Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293951,293958#msg-293958 From nginx-forum at forum.nginx.org Thu Apr 14 11:35:34 2022 From: nginx-forum at forum.nginx.org (arx) Date: Thu, 14 Apr 2022 07:35:34 -0400 Subject: reverse proxy with dns control In-Reply-To: References: <20220414104658.GW14624@daoine.org> Message-ID: I succeeded, practically the directives roxy_buffering off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; they had to be placed on top location "if ($host ~ testdns) { and under location / { now I should make an external file with all allowed dns I would like someone to help me with the syntax Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293951,293959#msg-293959 From francis at daoine.org Thu Apr 14 12:26:19 2022 From: francis at daoine.org (Francis Daly) Date: Thu, 14 Apr 2022 13:26:19 +0100 Subject: reverse proxy with dns control In-Reply-To: References: <20220414104658.GW14624@daoine.org> Message-ID: <20220414122619.GX14624@daoine.org> On Thu, Apr 14, 2022 at 07:02:28AM -0400, arx wrote: Hi there, > the important thing for me is the dns, the port is static and no server do > the check, > the problem that I don't know how it is calls the variable with what name > the client makes the request (the dns that is invoked in the GET method by > the client) present in access.log > > [14/Apr/2022:12:22:57 +0200] "GET /favicon.ico HTTP/1.1" 404 548 > "http://DNS:PORT/" "Mozilla/5.0 (........ log_format (http://nginx.org/r/log_format) describes what is written to access.log (access_log on the same page). The part you mention there is $http_referer; but you probably want to use $host. See http://nginx.org/en/docs/http/request_processing.html, so that you do not have to use $host. > I have to check on dns, and when I go to put the condition (as in the > previous example it gives me a syntax error) I believe you will be much happier if you do something like """ server { listen port; server_name good-name-one good-name-two good-name-three; location / { # proxy_pass or whatever is wanted. For testing: return 200 "Ok - host $host is allowed\n"; } } server { listen port default_server; return 200 "No - host $host is not allowed\n"; } """ where "port" is changed to the correct number in each case. Set the "good names" that you want to allow, and see that you get the "no" or "ok" message for the different names that you test. And then change the "return" lines to do what you want. Good luck with it, f -- Francis Daly francis at daoine.org From noloader at gmail.com Thu Apr 14 14:56:58 2022 From: noloader at gmail.com (Jeffrey Walton) Date: Thu, 14 Apr 2022 10:56:58 -0400 Subject: Spurious DNS lookups due to Host header? Message-ID: Hi Everyone, I'm examining a webapp which had a scan looking for security related errata and vulnerabilities. The app is hosted on Google Cloud (GPC) and the webserver is Nginx. Only the app was scanned. GPC and Nginx were not scanned. The scan produced an interesting finding I have not seen before. The finding is, a HTTP Request using a fake Host: header produces a DNS lookup. I think the concern is a DNS amplification attack (or maybe just some extra traffic). I think this is how the errata or attack works. Below, theHost: header is different from the hostname at the TLS layer. echo -e "GET / HTTP/1.1\r\nHost:www.fake-example.com\r\n\r\n" | \ openssl s_client -connect www.example.com:443 -servername www.example.com My question is, is Nginx expected to perform a lookup for www.fake-example.com? (At this point I have not ruled out GPC doing the DNS lookup. Nginx has a public mailing list, so it is easier to start here than trying to use Google {non-}support). Jeff From mdounin at mdounin.ru Thu Apr 14 20:11:36 2022 From: mdounin at mdounin.ru (Maxim Dounin) Date: Thu, 14 Apr 2022 23:11:36 +0300 Subject: Spurious DNS lookups due to Host header? In-Reply-To: References: Message-ID: Hello! On Thu, Apr 14, 2022 at 10:56:58AM -0400, Jeffrey Walton wrote: > Hi Everyone, > > I'm examining a webapp which had a scan looking for security related > errata and vulnerabilities. The app is hosted on Google Cloud (GPC) > and the webserver is Nginx. Only the app was scanned. GPC and Nginx > were not scanned. > > The scan produced an interesting finding I have not seen before. The > finding is, a HTTP Request using a fake Host: header produces a DNS > lookup. I think the concern is a DNS amplification attack (or maybe > just some extra traffic). > > I think this is how the errata or attack works. Below, theHost: header > is different from the hostname at the TLS layer. > > echo -e "GET / HTTP/1.1\r\nHost:www.fake-example.com\r\n\r\n" | \ > openssl s_client -connect www.example.com:443 -servername www.example.com > > My question is, is Nginx expected to perform a lookup for www.fake-example.com? No (unless you've configured nginx to do so). -- Maxim Dounin http://mdounin.ru/ From nginx-forum at forum.nginx.org Fri Apr 15 04:29:28 2022 From: nginx-forum at forum.nginx.org (shanlei) Date: Fri, 15 Apr 2022 00:29:28 -0400 Subject: bug in "search_headers_in" Message-ID: Inside nginx blog: "Managing request headers" , there is a method: search_headers_in which can search for arbitrary headers, however this method use ngx_strcasecmp( "ngx_strcasecmp(u_char *s1, u_char *s2)") which assume the input s1 must be '\0' terminated. so inside the code below, this function may get wrong result , beause name is not '\0\ terminated. " if (len != h[i].key.len || ngx_strcasecmp(name, h[i].key.data) != 0) { /* This header doesn't match. */ continue; } " the right way use "search_headers_in" is: ngx_strsearch_header2; ngx_str_t search_header=ngx_string("to_be_searched"); search_header2.data=ngx_pnlloc(search_header.len+1); search_header2.len=search_header.len; search_headers_in(r, search_header2.data, search_header2.len); ========================== static ngx_table_elt_t * search_headers_in(ngx_http_request_t *r, u_char *name, size_t len) { ngx_list_part_t *part; ngx_table_elt_t *h; ngx_uint_t i; /* Get the first part of the list. There is usual only one part. */ part = &r->headers_in.headers.part; h = part->elts; /* Headers list array may consist of more than one part, so loop through all of it */ for (i = 0; /* void */ ; i++) { if (i >= part->nelts) { if (part->next == NULL) { /* The last part, search is done. */ break; } part = part->next; h = part->elts; i = 0; } /* Just compare the lengths and then the names case insensitively. */ if (len != h[i].key.len || ngx_strcasecmp(name, h[i].key.data) != 0) { /* This header doesn't match. */ continue; } /* Ta-da, we got one! Note, we'v stop the search at the first matched header while more then one header may fit. */ return &h[i]; } /* No headers was found */ return NULL; } ============================= Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293970,293970#msg-293970 From kaushalshriyan at gmail.com Fri Apr 22 16:33:57 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Fri, 22 Apr 2022 22:03:57 +0530 Subject: Purge the Nginx cache Message-ID: Hi, I am running the nginx version: nginx/1.20.2 as a reverse proxy server on CentOS Linux release 7.9.2009 (Core). Is there a way to purge the cache without restarting the nginx server? I am reading a blog which says to use nginx bypass purge cache method instead of manually purging Nginx cache using the below method. $sudo rm -rf /var/cache/nginx/* Please let me know the best recommended way to purge cache. Thanks in advance. I look forward to hearing from you. Best Regards, Kaushal -------------- next part -------------- An HTML attachment was scrubbed... URL: From osa at freebsd.org.ru Fri Apr 22 16:58:02 2022 From: osa at freebsd.org.ru (Sergey A. Osokin) Date: Fri, 22 Apr 2022 19:58:02 +0300 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: Hi Kaushal, hope you're doing well. On Fri, Apr 22, 2022 at 10:03:57PM +0530, Kaushal Shriyan wrote: > Hi, > > I am running the nginx version: nginx/1.20.2 as a reverse proxy server on > CentOS Linux release 7.9.2009 (Core). Is there a way to purge the cache > without restarting the nginx server? I am reading a blog which says to use > nginx bypass purge cache method instead of manually purging Nginx cache > using the below method. > > $sudo rm -rf /var/cache/nginx/* > > Please let me know the best recommended way to purge cache. Thanks in > advance. I look forward to hearing from you. I'd recommend to follow the NGINX Admin Guide, please visit the following link for details, https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ -- Sergey A. Osokin From kaushalshriyan at gmail.com Fri Apr 22 17:26:27 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Fri, 22 Apr 2022 22:56:27 +0530 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: On Fri, Apr 22, 2022 at 10:31 PM Sergey A. Osokin wrote: > Hi Kaushal, > > hope you're doing well. > > On Fri, Apr 22, 2022 at 10:03:57PM +0530, Kaushal Shriyan wrote: > > Hi, > > > > I am running the nginx version: nginx/1.20.2 as a reverse proxy server on > > CentOS Linux release 7.9.2009 (Core). Is there a way to purge the cache > > without restarting the nginx server? I am reading a blog which says to > use > > nginx bypass purge cache method instead of manually purging Nginx cache > > using the below method. > > > > $sudo rm -rf /var/cache/nginx/* > > > > Please let me know the best recommended way to purge cache. Thanks in > > advance. I look forward to hearing from you. > > I'd recommend to follow the NGINX Admin Guide, please visit the following > link > for details, > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ > > -- > Sergey A. Osokin > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org Thanks Sergey for sharing the article. Is this https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ applicable to the OSS version of nginx web server. Please comment. Thanks in advance. I look forward to hearing from you. Best Regards, Kaushal -------------- next part -------------- An HTML attachment was scrubbed... URL: From osa at freebsd.org.ru Fri Apr 22 17:37:56 2022 From: osa at freebsd.org.ru (Sergey A. Osokin) Date: Fri, 22 Apr 2022 20:37:56 +0300 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: On Fri, Apr 22, 2022 at 10:56:27PM +0530, Kaushal Shriyan wrote: > On Fri, Apr 22, 2022 at 10:31 PM Sergey A. Osokin > > > > I'd recommend to follow the NGINX Admin Guide, please visit the following > > link > > for details, > > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ > > Thanks Sergey for sharing the article. Is this > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ > applicable to the OSS version of nginx web server. Please comment. I see nothing related to NGINX Plus, so you should try and report back. -- Sergey A. Osokin From kaushalshriyan at gmail.com Fri Apr 22 17:51:14 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Fri, 22 Apr 2022 23:21:14 +0530 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: On Fri, Apr 22, 2022 at 11:11 PM Sergey A. Osokin wrote: > On Fri, Apr 22, 2022 at 10:56:27PM +0530, Kaushal Shriyan wrote: > > On Fri, Apr 22, 2022 at 10:31 PM Sergey A. Osokin > > > > > > I'd recommend to follow the NGINX Admin Guide, please visit the > following > > > link > > > for details, > > > > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ > > > > Thanks Sergey for sharing the article. Is this > > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ > > applicable to the OSS version of nginx web server. Please comment. > > I see nothing related to NGINX Plus, so you should try and report back. > > -- > Sergey A. Osokin > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org Thanks a lot Sergey and much appreciated !!! I will seek help if I get into any issue. Best Regards, Kaushal -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaushalshriyan at gmail.com Tue Apr 26 17:58:00 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Tue, 26 Apr 2022 23:28:00 +0530 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: Hi Sergey, I have followed the document to purge nginx cache. Please find the details below. I am attaching the nginx config (nginxdefault.conf) file for your reference. curl -I https://testnginxproxycachepurge.testintcraft.com -H 'Cache-Purge: true' HTTP/1.1 200 OK Server: nginx/1.20.2 Date: Tue, 26 Apr 2022 17:51:54 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Cache-Control: max-age=21600, public Link: ; rel="canonical", ; rel="shortlink", ; rel="revision" X-UA-Compatible: IE=edge Content-language: en X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN Permissions-Policy: interest-cohort=() Expires: Sun, 19 Nov 1978 05:00:00 GMT Vary: Cookie X-XSS-Protection: 1; mode=block Strict-Transport-Security: max-age=31536000; includeSubDomains Set-Cookie: ADRUM_BT=R%3A0%7Cg%3A8eea40a7-2011-4692-acbb-84cf43e1d5ad30%7Cn%3Aicebergtest_e1c60ae6-5d00-47d5-8c0a-690d8465795f%7Ci%3A129601; expires=Tue, 26-Apr-2022 14:10:31 GMT; Max-Age=30; path=/ Last-Modified: Tue, 26 Apr 2022 11:42:25 GMT ETag: "1650973345" Access-Control-Allow-Origin: * *X-Cache-Status: HIT* Instead of *Cache: BYPASS*, I see *X-Cache-Status: HIT *as the response. Please guide me. Thanks in advance. Best Regards, Kaushal On Fri, Apr 22, 2022 at 11:21 PM Kaushal Shriyan wrote: > > > On Fri, Apr 22, 2022 at 11:11 PM Sergey A. Osokin > wrote: > >> On Fri, Apr 22, 2022 at 10:56:27PM +0530, Kaushal Shriyan wrote: >> > On Fri, Apr 22, 2022 at 10:31 PM Sergey A. Osokin >> > > >> > > I'd recommend to follow the NGINX Admin Guide, please visit the >> following >> > > link >> > > for details, >> > > >> https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ >> > >> > Thanks Sergey for sharing the article. Is this >> > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ >> > applicable to the OSS version of nginx web server. Please comment. >> >> I see nothing related to NGINX Plus, so you should try and report back. >> >> -- >> Sergey A. Osokin >> _______________________________________________ >> nginx mailing list -- nginx at nginx.org >> To unsubscribe send an email to nginx-leave at nginx.org > > > Thanks a lot Sergey and much appreciated !!! I will seek help if I get > into any issue. > > Best Regards, > > Kaushal > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginxdefault.conf Type: application/octet-stream Size: 5229 bytes Desc: not available URL: From kaushalshriyan at gmail.com Tue Apr 26 18:24:01 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Tue, 26 Apr 2022 23:54:01 +0530 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: Hi Sergey, I have gone through the document https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ to purge nginx cache in nginx OSS version: nginx/1.20.2 as a reverse proxy server on CentOS Linux release 7.9.2009 (Core). I encounter nginx: [emerg] unknown directive "proxy_cache_purge" in /etc/nginx/conf.d/default.conf:75 nginx: [emerg] unknown directive "proxy_cache_purge" Please guide me. Thanks in advance. Best Regards, Kaushal On Tue, Apr 26, 2022 at 11:28 PM Kaushal Shriyan wrote: > Hi Sergey, > > I have followed the document to purge nginx cache. Please find the details > below. I am attaching the nginx config (nginxdefault.conf) file for > your reference. > > curl -I https://testnginxproxycachepurge.testintcraft.com -H > 'Cache-Purge: true' > HTTP/1.1 200 OK > Server: nginx/1.20.2 > Date: Tue, 26 Apr 2022 17:51:54 GMT > Content-Type: text/html; charset=UTF-8 > Connection: keep-alive > Cache-Control: max-age=21600, public > Link: ; > rel="canonical", ; > rel="shortlink", ; > rel="revision" > X-UA-Compatible: IE=edge > Content-language: en > X-Content-Type-Options: nosniff > X-Frame-Options: SAMEORIGIN > Permissions-Policy: interest-cohort=() > Expires: Sun, 19 Nov 1978 05:00:00 GMT > Vary: Cookie > X-XSS-Protection: 1; mode=block > Strict-Transport-Security: max-age=31536000; includeSubDomains > Set-Cookie: > ADRUM_BT=R%3A0%7Cg%3A8eea40a7-2011-4692-acbb-84cf43e1d5ad30%7Cn%3Aicebergtest_e1c60ae6-5d00-47d5-8c0a-690d8465795f%7Ci%3A129601; > expires=Tue, 26-Apr-2022 14:10:31 GMT; Max-Age=30; path=/ > Last-Modified: Tue, 26 Apr 2022 11:42:25 GMT > ETag: "1650973345" > Access-Control-Allow-Origin: * > > *X-Cache-Status: HIT* > > Instead of *Cache: BYPASS*, I see *X-Cache-Status: HIT *as the response. > Please guide me. Thanks in advance. > > Best Regards, > > Kaushal > > > On Fri, Apr 22, 2022 at 11:21 PM Kaushal Shriyan > wrote: > >> >> >> On Fri, Apr 22, 2022 at 11:11 PM Sergey A. Osokin >> wrote: >> >>> On Fri, Apr 22, 2022 at 10:56:27PM +0530, Kaushal Shriyan wrote: >>> > On Fri, Apr 22, 2022 at 10:31 PM Sergey A. Osokin >>> > > >>> > > I'd recommend to follow the NGINX Admin Guide, please visit the >>> following >>> > > link >>> > > for details, >>> > > >>> https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ >>> > >>> > Thanks Sergey for sharing the article. Is this >>> > >>> https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ >>> > applicable to the OSS version of nginx web server. Please comment. >>> >>> I see nothing related to NGINX Plus, so you should try and report back. >>> >>> -- >>> Sergey A. Osokin >>> _______________________________________________ >>> nginx mailing list -- nginx at nginx.org >>> To unsubscribe send an email to nginx-leave at nginx.org >> >> >> Thanks a lot Sergey and much appreciated !!! I will seek help if I get >> into any issue. >> >> Best Regards, >> >> Kaushal >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From osa at freebsd.org.ru Tue Apr 26 20:38:47 2022 From: osa at freebsd.org.ru (Sergey A. Osokin) Date: Tue, 26 Apr 2022 23:38:47 +0300 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: Hi Kaushal, On Tue, Apr 26, 2022 at 11:54:01PM +0530, Kaushal Shriyan wrote: > Hi Sergey, > > I have gone through the document > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ to > purge nginx cache in nginx OSS version: nginx/1.20.2 as a reverse proxy > server on CentOS Linux release 7.9.2009 (Core). I encounter > > nginx: [emerg] unknown directive "proxy_cache_purge" in > /etc/nginx/conf.d/default.conf:75 > nginx: [emerg] unknown directive "proxy_cache_purge" > > Please guide me. Thanks in advance. Accoring to the ngx_http_proxy_module documentation [1], the proxy_cache_purge directive is available as part of the commercial subscription. References: [1] https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_purge -- Sergey A. Osokin From kaushalshriyan at gmail.com Thu Apr 28 19:24:42 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Fri, 29 Apr 2022 00:54:42 +0530 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: Hi, I am following https://www.ryadel.com/en/nginx-purge-proxy-cache-delete-invalidate-linux-centos-7/ and https://bluegrid.io/edu/how-to-purge-the-nginx-cache/ to purge cache. I am attaching the nginx file for your reference. $curl -I https://gsmanginxproxycachepurge.testapicraft.com -H "secret-header: true" HTTP/1.1 200 OK Server: nginx/1.20.2 Date: Thu, 28 Apr 2022 19:21:54 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Cache-Control: max-age=21600, public Link: ; rel="canonical", ; rel="shortlink", ; rel="revision" X-UA-Compatible: IE=edge Content-language: en X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN Permissions-Policy: interest-cohort=() Expires: Sun, 19 Nov 1978 05:00:00 GMT Vary: Cookie X-XSS-Protection: 1; mode=block Strict-Transport-Security: max-age=31536000; includeSubDomains Set-Cookie: ADRUM_BT=R%3A0%7Cg%3A5277dd0a-8de6-440a-a8f7-52fb782db25114%7Cn%3Aicebergtest_e1c60ae6-5d00-47d5-8c0a-690d8465795f%7Ci%3A129601; expires=Thu, 28-Apr-2022 19:14:45 GMT; Max-Age=30; path=/ Last-Modified: Tue, 26 Apr 2022 11:42:25 GMT ETag: "1650973345" Access-Control-Allow-Origin: * *X-Cache-Status: HIT* I am seeing it as HIT instead of BYPASS and I am not sure about this term between HIT vs MISS vs BYPASS vs EXPIRED in context to Nginx cache. Please guide me. Thanks in advance. Best Regards, Kaushal On Wed, Apr 27, 2022 at 2:12 AM Sergey A. Osokin wrote: > Hi Kaushal, > > On Tue, Apr 26, 2022 at 11:54:01PM +0530, Kaushal Shriyan wrote: > > Hi Sergey, > > > > I have gone through the document > > https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/ > to > > purge nginx cache in nginx OSS version: nginx/1.20.2 as a reverse proxy > > server on CentOS Linux release 7.9.2009 (Core). I encounter > > > > nginx: [emerg] unknown directive "proxy_cache_purge" in > > /etc/nginx/conf.d/default.conf:75 > > nginx: [emerg] unknown directive "proxy_cache_purge" > > > > Please guide me. Thanks in advance. > > Accoring to the ngx_http_proxy_module documentation [1], the > proxy_cache_purge > directive is available as part of the commercial subscription. > > References: > [1] > https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_purge > > -- > Sergey A. Osokin > _______________________________________________ > nginx mailing list -- nginx at nginx.org > To unsubscribe send an email to nginx-leave at nginx.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: nginxpurge.conf Type: application/octet-stream Size: 5322 bytes Desc: not available URL: From kaushalshriyan at gmail.com Fri Apr 29 18:14:37 2022 From: kaushalshriyan at gmail.com (Kaushal Shriyan) Date: Fri, 29 Apr 2022 23:44:37 +0530 Subject: Purge the Nginx cache In-Reply-To: References: Message-ID: On Fri, Apr 29, 2022 at 12:54 AM Kaushal Shriyan wrote: > Hi, > > I am following > https://www.ryadel.com/en/nginx-purge-proxy-cache-delete-invalidate-linux-centos-7/ > and https://bluegrid.io/edu/how-to-purge-the-nginx-cache/ to purge cache. > I am attaching the nginx file for your reference. > > $curl -I https://gsmanginxproxycachepurge.testapicraft.com -H > "secret-header: true" > > HTTP/1.1 200 OK > Server: nginx/1.20.2 > Date: Thu, 28 Apr 2022 19:21:54 GMT > Content-Type: text/html; charset=UTF-8 > Connection: keep-alive > Cache-Control: max-age=21600, public > Link: ; > rel="canonical", ; > rel="shortlink", ; > rel="revision" > X-UA-Compatible: IE=edge > Content-language: en > X-Content-Type-Options: nosniff > X-Frame-Options: SAMEORIGIN > Permissions-Policy: interest-cohort=() > Expires: Sun, 19 Nov 1978 05:00:00 GMT > Vary: Cookie > X-XSS-Protection: 1; mode=block > Strict-Transport-Security: max-age=31536000; includeSubDomains > Set-Cookie: > ADRUM_BT=R%3A0%7Cg%3A5277dd0a-8de6-440a-a8f7-52fb782db25114%7Cn%3Aicebergtest_e1c60ae6-5d00-47d5-8c0a-690d8465795f%7Ci%3A129601; > expires=Thu, 28-Apr-2022 19:14:45 GMT; Max-Age=30; path=/ > Last-Modified: Tue, 26 Apr 2022 11:42:25 GMT > ETag: "1650973345" > Access-Control-Allow-Origin: * > > *X-Cache-Status: HIT* > > I am seeing it as HIT instead of BYPASS and I am not sure about this term > between HIT vs MISS vs BYPASS vs EXPIRED in context to Nginx cache. > > Please guide me. Thanks in advance. > > Best Regards, > > Kaushal > >> >> Hi, I will appreciate it if someone can pitch in for my earlier post to this mailing list. Thanks in Advance. Best Regards, Kaushal -------------- next part -------------- An HTML attachment was scrubbed... URL: