RE: Uploading files to remote server running nginx 1.24 returns http status code 405 Not Allowed.

2023-12-18 Thread Reinis Rozitis
> When I am trying to upload files by hitting 
> https://software.example.com/upload_form.html I am encountering http status 
> code 405 Not Allowed. Please find inline a screenshot for your reference. 

Does your upload form point exactly to '/upload.php' ? as by by default Nginx 
doesn't allow POST on static content which would indicate that the form submits 
to a static document.

rr
___
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx


Capture full request/response body logging in nginx configured in reverse proxy mode reports nginx: [emerg] unknown directive "log_by_lua_block"

2023-12-18 Thread Kaushal Shriyan
Hi,

I am running nginx version: nginx/1.24.0 as reverse proxy on CentOS Linux
release 7.9.2009 (Core). I have the below config
file /etc/nginx/conf.d/microservice.conf
I want to capture full request/response body logging in nginx.

# cat /etc/nginx/conf.d/microservice.conf
server {
listen 80;
server_name 192.168.0.129;

location / {
# Capture request headers and body
log_by_lua_block {
ngx.var.request_headers = ngx.req.raw_header()
ngx.var.request_body = ngx.req.get_body_data()
}

# Your regular location configuration here

# Capture response headers and body
body_filter_by_lua_block {
local resp_body = ngx.arg[1]
ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body
if ngx.arg[2] then
ngx.var.resp_body = ngx.ctx.buffered
end
}
}
#nginx -t
*nginx: [emerg] unknown directive "log_by_lua_block" in*
/etc/nginx/conf.d/microservice.conf:8
nginx: configuration file /etc/nginx/nginx.conf test failed

Please guide me. Thanks in advance.

Best Regards,

Kaushal
___
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx


Re: Capture full request/response body logging in nginx configured in reverse proxy mode reports nginx: [emerg] unknown directive "log_by_lua_block"

2023-12-18 Thread Sergey A. Osokin
Hi Kaushal,

On Mon, Dec 18, 2023 at 10:24:14PM +0530, Kaushal Shriyan wrote:
> 
> I am running nginx version: nginx/1.24.0 as reverse proxy on CentOS Linux
> release 7.9.2009 (Core). I have the below config
> file /etc/nginx/conf.d/microservice.conf
> I want to capture full request/response body logging in nginx.

Since you question is related to a third-party module, I'd recommend
to get support in a appropriate mailing list.

Thank you.

-- 
Sergey A. Osokin
___
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx


Re: Capture full request/response body logging in nginx configured in reverse proxy mode reports nginx: [emerg] unknown directive "log_by_lua_block"

2023-12-18 Thread Kaushal Shriyan
On Mon, Dec 18, 2023 at 11:19 PM Sergey A. Osokin 
wrote:

> Hi Kaushal,
>
> On Mon, Dec 18, 2023 at 10:24:14PM +0530, Kaushal Shriyan wrote:
> >
> > I am running nginx version: nginx/1.24.0 as reverse proxy on CentOS Linux
> > release 7.9.2009 (Core). I have the below config
> > file /etc/nginx/conf.d/microservice.conf
> > I want to capture full request/response body logging in nginx.
>
> Since you question is related to a third-party module, I'd recommend
> to get support in a appropriate mailing list.
>
>
Thanks Sergey for the quick response. Is there a way to capture full
request/response body logging in nginx without Lua module support? Please
ignore the earlier OS version, CentOS Linux release 7.9.2009 (Core).

#cat /etc/redhat-release
Red Hat Enterprise Linux release 8.8 (Ootpa)
# nginx -V
nginx version: nginx/1.24.0
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC)
built with OpenSSL 1.1.1k  FIPS 25 Mar 2021
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx
--modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid
--lock-path=/var/run/nginx.lock
--http-client-body-temp-path=/var/cache/nginx/client_temp
--http-proxy-temp-path=/var/cache/nginx/proxy_temp
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
--http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx
--with-compat --with-file-aio --with-threads --with-http_addition_module
--with-http_auth_request_module --with-http_dav_module
--with-http_flv_module --with-http_gunzip_module
--with-http_gzip_static_module --with-http_mp4_module
--with-http_random_index_module --with-http_realip_module
--with-http_secure_link_module --with-http_slice_module
--with-http_ssl_module --with-http_stub_status_module
--with-http_sub_module --with-http_v2_module --with-mail
--with-mail_ssl_module --with-stream --with-stream_realip_module
--with-stream_ssl_module --with-stream_ssl_preread_module
--with-cc-opt='-O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

# rpm -qa | grep nginx
nginx-1.24.0-1.el8.ngx.x86_64
#nginx -v
nginx version: nginx/1.24.0
#

# yum search nginx
Updating Subscription Management repositories.
Last metadata expiration check: 3:07:49 ago on Mon 18 Dec 2023 08:40:51 PM
IST.
 Name
Exactly Matched: nginx
=
nginx.x86_64 : High performance web server
=== Name &
Summary Matched: nginx

collectd-nginx.x86_64 : Nginx plugin for collectd
lemonldap-ng-nginx.noarch : LemonLDAP-NG Nginx support
munin-nginx.noarch : NGINX support for Munin resource monitoring
nginx-all-modules.noarch : A meta package that installs all available Nginx
modules
nginx-debuginfo.x86_64 : Debug information for package nginx
nginx-filesystem.noarch : The basic directory layout for the Nginx server
nginx-mod-http-image-filter.x86_64 : Nginx HTTP image filter module
nginx-mod-http-perl.x86_64 : Nginx HTTP perl module
nginx-mod-http-xslt-filter.x86_64 : Nginx XSLT module
nginx-mod-mail.x86_64 : Nginx mail modules
nginx-mod-stream.x86_64 : Nginx stream modules
nginx-module-image-filter.x86_64 : nginx image filter dynamic module
nginx-module-image-filter-debuginfo.x86_64 : Debug information for package
nginx-module-image-filter
nginx-module-njs.x86_64 : nginx njs dynamic modules
nginx-module-njs-debuginfo.x86_64 : Debug information for package
nginx-module-njs
nginx-module-perl.x86_64 : nginx Perl dynamic module
nginx-module-perl-debuginfo.x86_64 : Debug information for package
nginx-module-perl
nginx-module-xslt.x86_64 : nginx xslt dynamic module
nginx-module-xslt-debuginfo.x86_64 : Debug information for package
nginx-module-xslt
pagure-web-nginx.noarch : Nginx configuration for Pagure
pcp-pmda-nginx.x86_64 : Performance Co-Pilot (PCP) metrics for the Nginx
Webserver
python3-certbot-nginx.noarch : The nginx plugin for certbot
sympa-nginx.x86_64 : Sympa with nginx
# yum -y install nginx-all-modules.noarch
Updating Subscription Management repositories.
Last metadata expiration check: 3:08:26 ago on Mon 18 Dec 2023 08:40:51 PM
IST.
Dependencies resolved.
==
 Package   Architecture