Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user nginx;
- worker_processes auto;
- error_log /var/log/nginx/error.log warn;
- pid /var/run/nginx.pid;
- load_module modules/ndk_http_module.so;
- load_module modules/ngx_http_lua_module.so;
- events {
- worker_connections 1024;
- }
- http {
- proxy_read_timeout 3600;
- keepalive_timeout 10m;
- proxy_connect_timeout 600s;
- fastcgi_send_timeout 600s;
- send_timeout 600;
- fastcgi_read_timeout 600s;
- lua_package_path "./lua/?.lua;;";
- # include /etc/nginx/mime.types;
- default_type application/octet-stream;
- # log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- # '$status $body_bytes_sent "$http_referer" '
- # '"$http_user_agent" "$http_x_forwarded_for"'
- log_format main2 '$remote_addr - $remote_user [$time_local] '
- '\n\n"$request" \n status: $status body_bytes_sent: $body_bytes_sent '
- '\n\n http_referer: "$http_referer" \n "$http_user_agent" $request_time '
- '\n\n req_headers: \n "$req_headers" \n\n req_body: \n "$req_body" \n\n resp_body: \n "$resp_body"';
- access_log /var/log/nginx/access.log main2;
- sendfile on;
- #tcp_nopush on;
- # keepalive_timeout 65;
- #gzip on;
- # include /etc/nginx/conf.d/*.conf;
- server {
- server_name XXXXXXX.RU;
- listen 80;
- lua_need_request_body on;
- set $resp_body "";
- set $req_body "";
- set $req_headers "";
- client_body_buffer_size 16k;
- client_max_body_size 16k;
- rewrite_by_lua_block {
- local req_headers = "Headers: ";
- ngx.var.req_body = ngx.req.get_body_data();
- local h, err = ngx.req.get_headers()
- for k, v in pairs(h) do
- req_headers = req_headers .. k .. ": " .. v .. "\n";
- end
- ngx.var.req_headers = req_headers;
- }
- body_filter_by_lua '
- local resp_body = string.sub(ngx.arg[1], 1, 1000)
- ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body
- if ngx.arg[2] then
- ngx.var.resp_body = ngx.ctx.buffered
- end
- ';
- location / {
- proxy_pass https://XXXXXXX.RU;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- # proxy_set_header Host $http_host;
- proxy_set_header Cookie $http_cookie;
- proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- proxy_ssl_ciphers GOST2012-GOST8912-GOST8912:HIGH:MEDIUM;
- proxy_ssl_certificate /etc/nginx/ssl/ivanovIvanIvanovich.pem;
- proxy_ssl_certificate_key /etc/nginx/ssl/prkeyunitIvanov.key;
- proxy_ssl_server_name on;
- # proxy_redirect off;
- # root html;
- # index index.html index.htm;
- }
- }
- server {
- # server_name XXXXXXX.RU;
- listen 8080;
- lua_need_request_body on;
- set $resp_body "";
- set $req_body "";
- set $req_headers "";
- client_body_buffer_size 16k;
- client_max_body_size 16k;
- rewrite_by_lua_block {
- local req_headers = "Headers: ";
- ngx.var.req_body = ngx.req.get_body_data();
- local h, err = ngx.req.get_headers()
- for k, v in pairs(h) do
- req_headers = req_headers .. k .. ": " .. v .. "\n";
- end
- ngx.var.req_headers = req_headers;
- }
- body_filter_by_lua '
- local resp_body = string.sub(ngx.arg[1], 1, 1000)
- ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body
- if ngx.arg[2] then
- ngx.var.resp_body = ngx.ctx.buffered
- end
- ';
- location / {
- proxy_pass https://XXXXXXX.RU;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Cookie $http_cookie;
- proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- proxy_ssl_ciphers GOST2012-GOST8912-GOST8912:HIGH:MEDIUM;
- proxy_ssl_certificate /etc/nginx/ssl/PetrovIvanSemenovich.pem;
- proxy_ssl_certificate_key /etc/nginx/ssl/prkeyunitSemenovich.key;
- proxy_ssl_server_name on;
- }
- }
- server {
- # server_name XXXXXXX.RU;
- listen 8585;
- lua_need_request_body on;
- set $resp_body "";
- set $req_body "";
- set $req_headers "";
- client_body_buffer_size 16k;
- client_max_body_size 16k;
- rewrite_by_lua_block {
- local req_headers = "Headers: ";
- ngx.var.req_body = ngx.req.get_body_data();
- local h, err = ngx.req.get_headers()
- for k, v in pairs(h) do
- req_headers = req_headers .. k .. ": " .. v .. "\n";
- end
- ngx.var.req_headers = req_headers;
- }
- body_filter_by_lua '
- local resp_body = string.sub(ngx.arg[1], 1, 1000)
- ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body
- if ngx.arg[2] then
- ngx.var.resp_body = ngx.ctx.buffered
- end
- ';
- location / {
- proxy_pass https://XXXXXXX.RU;
- proxy_ssl_server_name on;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Cookie $http_cookie;
- proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- proxy_ssl_ciphers GOST2012-GOST8912-GOST8912:HIGH:MEDIUM;
- proxy_ssl_certificate /etc/nginx/ssl/Petrovich.pem;
- proxy_ssl_certificate_key /etc/nginx/ssl/prkeyunitPetrovich.key;
- }
- }
- }
Advertisement
Comments
-
- Лог в nginx выглядит следующим образом.
- 2023/01/19 11:49:50 [error] 3218459#3218459: *255 SSL_do_handshake() failed (SSL: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac) while SSL handshaking to upstream, client: XX.XXX.XXX.89, server: , request: "GET /INC/libraries-js.dsp;jsessionid=f1p4v6rzb4l2pmjswte5ng2q HTTP/1.1", upstream: "https://XX.XXX.X.XX:443/INC/libraries-js.dsp;jsessionid=f1p4v6rzb4l2pmjswte5ng2q", host: "XX.XXX.XX.XXX:8585", referrer: "http://XX.XXX.XX.XXX/INC/INC/scroller.zul?navigationId=D04_Client"
-
- У себя же в Jmeter вижу, что возвращается так.
- <html>
- <head><title>502 Bad Gateway</title></head>
- <body>
- <center><h1>502 Bad Gateway</h1></center>
- <hr><center>nginx/1.18.0 (Ubuntu)</center>
- </body>
- </html>
- <!-- a padding to disable MSIE and Chrome friendly error page -->
- <!-- a padding to disable MSIE and Chrome friendly error page -->
- <!-- a padding to disable MSIE and Chrome friendly error page -->
- <!-- a padding to disable MSIE and Chrome friendly error page -->
- <!-- a padding to disable MSIE and Chrome friendly error page -->
- <!-- a padding to disable MSIE and Chrome friendly error page -->
Add Comment
Please, Sign In to add comment
Advertisement