Welcome! Log In Create A New Profile

Advanced

NGINX - {“status”:400,“message”:“Bad request”} Every alternate request getting 400

March 14, 2020 09:38AM
I Have below nginx config and the api hit works fine every first time and
alternate hit getting 400.

nginx.conf:

http {

lua_package_path '~/lua/?.lua;;';

# Allow larger than normal headers
large_client_header_buffers 4 64k;

ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

include /etc/nginx/gateway.conf;
}
gateway.conf

server {

listen 443 ssl;

location = /_dosomething {
internal;

# Validate oauth token and add custom nginx access_token into the
request header
access_by_lua_file /etc/nginx/api_conf.d/oauth/oauth_introspec.lua;

mirror /_NULL; # Create a copy of the request to
capture request body
client_body_in_single_buffer on; # Minimize memory copy operations on
request body
client_body_buffer_size 16k; # Largest body to keep in memory
(before writing to file)
client_max_body_size 16k;

# Policy configuration here (authentication, rate limiting, logging,
more...)

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;


proxy_pass https://$upstream$request_uri;

}

}
Am not seeing any specific errors in nginx error log too, i can see the log
before proxy pass. added below line too

error_log logs/error.log debug;
Every alternate requests are getting 400 bad request. But constant interval
requests are getting success response and if i test with 2 requests per
second then it fails with this error. am out of options. Please help.



--
Sent from: http://nginx.2469901.n2.nabble.com/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

NGINX - {“status”:400,“message”:“Bad request”} Every alternate request getting 400

satscreate March 14, 2020 09:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 215
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready