Re: Regex in proxy_hide_header

2018-05-02 Thread bmrf
Oleg A. Mamontov Wrote:
---
> On Wed, May 02, 2018 at 09:34:04AM +, bmrf wrote:
> >Hi list,
> >
> >I was trying to unset/delete a header using proxy_hide_header. The
> problem
> >is that the header name is always unknown, but it has always the same
> >pattern, it starts with several whitespaces followed by random
> characters,
> >something like \s+\w+
> >
> >If regex is not supported at proxy_hide_header, as it seems it is, 
> is there
> >any other way to accomplish this?
> 
> Probably it makes sense to take a look:
> https://github.com/openresty/headers-more-nginx-module#more_clear_head
> ers
> 
> "The wildcard character, *, can also be used at the end of the header
> name to specify a pattern."

The header I need to delete is always different, each time a request is done
it is different and alway with this weird patter  \s+\w+. (4 whitespaces
followed by 8 random characters)

Some real examples, it's cut to 1 whitespace character, but there're 4:

" XkIOPalY"
"peYhKOlx"
"KpyTKolq"

So using headers-more-nginx-module wildcard character, *, at the end of the
header name does not help here. Anyway, thank you and if you have any other
suggestion it's more than welcome.




> >
> >Thanks a lot!
> 
> -- 
> Cheers,
> Oleg A. Mamontov
> 
> mailto: o...@mamontov.net
> 
> skype:  lonerr11
> cell:   +7 (903) 798-1352
> ___
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,279657,279660#msg-279660

___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Re: Knowing the server port inside Perl code

2018-05-02 Thread Maxim Dounin
Hello!

On Tue, May 01, 2018 at 08:47:15AM +0200, Ondrej Jombik wrote:

> When using mail module for SMTP and doing auth using Perl code, it might
> be handy to know entry port number. For example 25/TCP, 465/TCP or
> 587/TCP; those are the most used ones.
> 
> I thought this would be somewhere among provided headers:
> 
>$request->header_in('Auth-Method');
>$request->header_in('Auth-Protocol');
>$request->header_in('Auth-User');
>$request->header_in('Auth-Pass');
>$request->header_in('Auth-Salt');
>$request->header_in('Client-IP');
>$request->header_in('Client-Host');
>[... ...]
> 
> However there is nothing like 'Auth-Port', or 'Client-Port' or
> 'Server-Port' or any port.
> 
> 'Auth-Protocol' is no help, because we have same protocol running on
> multiple ports; typically 25/TCP is the same as 587/TCP when sending
> e-mails with auth.
> 
> So I tried to help myself:
> 
>  proxy on;
>  auth_http_header Auth-Port $server_port;
>  auth_http 127.0.0.1:80/auth;
>  proxy_pass_error_message on;
> 
> - or -
> 
>  auth_http_header Auth-Port $proxy_port;
> 
> But none of those worked.
> 
> How I can know entry port number inside Perl code?

If you really want to know server port, you can get one by 
configuring different auth_http_header in server{} blocks 
listening on different ports.

-- 
Maxim Dounin
http://mdounin.ru/
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Re: Regex in proxy_hide_header

2018-05-02 Thread Oleg A. Mamontov

On Wed, May 02, 2018 at 09:34:04AM +, bmrf wrote:

Hi list,

I was trying to unset/delete a header using proxy_hide_header. The problem
is that the header name is always unknown, but it has always the same
pattern, it starts with several whitespaces followed by random characters,
something like \s+\w+

If regex is not supported at proxy_hide_header, as it seems it is,  is there
any other way to accomplish this?


Probably it makes sense to take a look:
https://github.com/openresty/headers-more-nginx-module#more_clear_headers

"The wildcard character, *, can also be used at the end of the header
name to specify a pattern."



Thanks a lot!


--
Cheers,
Oleg A. Mamontov

mailto: o...@mamontov.net

skype:  lonerr11
cell:   +7 (903) 798-1352
___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Regex in proxy_hide_header

2018-05-02 Thread bmrf
Hi list,

I was trying to unset/delete a header using proxy_hide_header. The problem
is that the header name is always unknown, but it has always the same
pattern, it starts with several whitespaces followed by random characters, 
something like \s+\w+ 

If regex is not supported at proxy_hide_header, as it seems it is,  is there
any other way to accomplish this?

Thanks a lot!

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,279657,279657#msg-279657

___
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx