Re: Passing the original client EHLO to the SMTP backend

2021-07-21 Thread kay
I've managed to get the desired result with a patch below: --- a/src/mail/ngx_mail_proxy_module.c +++ b/src/mail/ngx_mail_proxy_module.c @@ -574,7 +574,7 @@ cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module); -line.len = sizeof("HELO ") - 1 + cscf->server_name.len +

Passing the original client EHLO to the SMTP backend

2021-07-21 Thread kay
Hi, Currently only XCLIENT protocol supports passing "EHLO or HELO, as passed by the client" - http://nginx.org/en/docs/mail/ngx_mail_proxy_module.html#xclient I'm using PROXY protocol and nginx sends the hostname, specified in "server_name". Is it possible to pass the real client hostname to SMT

Re: Dynamically resolving smtp upstream hostnames

2021-06-28 Thread kay
Any clues on how to solve this? Do I need to submit a feature request to resolve SMTP hostnames the same way it is done in HTTP proxy_pass directive? Posted at Nginx Forum: https://forum.nginx.org/read.php?2,291890,291927#msg-291927 ___ nginx mailing l

Dynamically resolving smtp upstream hostnames

2021-06-18 Thread kay
I'm using a new "proxy_smtp_auth on;" option in my mail proxy server inside k8s cluster, therefore I just need to proxy_pass smtp requests to the backend. Since the backend must be set using the "auth_http" directive, I use the code below and provide the hostname instead of IP address: server {

Re: nginx DNS doesn't update the upstream IP

2021-04-16 Thread kay
Thanks for the hint! I haven't worked with domain names in proxy_pass before and was sure that they're resolved dynamically. I changed the config to: set $upstream_var example.com; proxy_pass https://$upstream_var; Posted at Nginx Forum: https://forum.nginx.org/read.php?2,291252,291286#msg-29128

Re: nginx DNS doesn't update the upstream IP

2021-04-14 Thread kay
Probably I also need to mention that "example.com" has more than one IP address (in our case 2) Posted at Nginx Forum: https://forum.nginx.org/read.php?2,291252,291256#msg-291256 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/l

Re: nginx DNS doesn't update the upstream IP

2021-04-14 Thread kay
Here is an example of the proxy_pass config, we don't use IP's proxy_pass https://example.com; When "example.com" changes the IP address, it is not reflected in nginx. We're using k8s pods. Sometime one or two pods have stale DNS cache. Other pods work fine... Posted at Nginx Forum: https://for

nginx DNS doesn't update the upstream IP

2021-04-14 Thread kay
We tested with a default "resolver 8.8.8.8;" and "resolver 8.8.8.8 30s;" options. Both keep using the outdated IP address until you run "nginx -s reload". The upstream is AWS LoadBalancer, which changes IPs quite frequently. I'm using nginx 1.19.3. Any clue what could be wrong? Posted at Nginx Fo

Re: Simple SMTP proxy without an auth (pass AUTH command to backend)

2020-09-30 Thread kay
> "TLS-only" might work if you use "stream" rather than "mail", so that > nginx is the TLS-termination of an otherwise-opaque stream of traffic. Thanks for the hint. I think I can omit starttls support and use only TLS Posted at Nginx Forum: https://forum.nginx.org/read.php?2,289589,289617#msg-2

Simple SMTP proxy without an auth (pass AUTH command to backend)

2020-09-29 Thread kay
I'd like to use nginx to serve TLS and/or StartTLS connections only, the rest must be "proxy passed" without a modification to the backend. Unfortunately I noticed https://www.ruby-forum.com/t/nginx-does-not-pass-smtp-auth-command-to-server/184290 topic, where Maxim Dounin mentioned that it is imp

Efficient stream proxy

2017-04-25 Thread kay
Hi, I'd like to implement proxy server for internet radio streaming. And I'd like to reuse existing established connection to the upstream for all clients which listen the same "radio station"/"url". Right now every listener creates a new connection on nginx side. Is it even possible to reuse one

Websockets proxy "Broken pipe"

2015-09-09 Thread kay
I have a problem with nginx and websockets proxy. Here is the message I receive: [error] 20999#0: *1997296 send() failed (32: Broken pipe) while proxying upgraded connection, client: 10.0.25.47, server: example.com, request: "GET /xmpp/ HTTP/1.1", upstream: "http://192.168.122.8:5280/xmpp/";, hos

Re: Escape slashes in log output for JSON format

2014-11-26 Thread kay
I've done the patch for nginx 1.6.2 Now if you use this config: access_log logs/access.log main json; Additional backslash for backslash should appear in log. And it will not break JSON format. Can someone review my changes? https://github.com/kayrus/nginx/commit/682f3684ea331e089aa124fe7fce84

Escape slashes in log output for JSON format

2014-11-24 Thread kay
I would like to add "json" option for additional escape for backslash character. So it will be: access_log path format json; The initial patch for 1.6.2 looks like: --- ./src/http/modules/ngx_http_log_module.c.orig +++ ./src/http/modules/ngx_http_log_module.c @@ -67,6 +67,7 @@ time_t

Re: What is the best way to reallocate memory for char array?

2014-11-17 Thread kay
Thanks. Is it necessary to use ngx_pfree(str) at the end of my function? Maxim Dounin Wrote: --- > Hello! > > On Mon, Nov 17, 2014 at 09:09:34AM -0500, kay wrote: > > > For example I've allocated memory for

Re: What is the best way to reallocate memory for char array?

2014-11-17 Thread kay
P.S. len2 > len1 Posted at Nginx Forum: http://forum.nginx.org/read.php?2,254851,254852#msg-254852 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

What is the best way to reallocate memory for char array?

2014-11-17 Thread kay
For example I've allocated memory for char *str: str = ngx_pnalloc(r->pool, len1); Then I've added some data to "str": ngx_sprintf(str, "abc"); How should I reallocate this memory? Should I use: str = ngx_pnalloc(r->pool, len2); ? And I would like to keep the str's "abc" data as well. Posted

Re: custom error pages for retun directive

2014-08-26 Thread kay
Thanks! Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252825,252880#msg-252880 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: custom error pages for retun directive

2014-08-26 Thread kay
How can "if in location" influence productivity? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252825,252844#msg-252844 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

custom error pages for retun directive

2014-08-26 Thread kay
It is not possible to set custom error page. For example /usr/share/nginx/404.html contains "test": server { error_page 404 /404.html; if ($request_method = "GET") return 404; } location / { proxy_pass http://localhost:8080; } location /404.html { /usr/share/nginx/404.html; } } curl -v 127.0

nginx priority for rewrite and access restriction

2014-05-27 Thread kay
I would like to enable /123 location only for locahost, but it doesn't work, nginx return 302 redirect with header. It seems rewrite directive has higher priority than access module. location /123 { satisfy all; allow 127.0.0.1/32; denyall;

Re: nginx rewrites $request_method on error

2014-05-16 Thread kay
I mean that I know how to avoid these errors, but I think that a better way to fix the issue is to fix it in low level. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,250145#msg-250145 ___ nginx mailing list nginx@nginx.org http://mail

Re: nginx rewrites $request_method on error

2014-05-15 Thread kay
Don't you think this is a bug? Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,250144#msg-250144 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: nginx rewrites $request_method on error

2014-05-14 Thread kay
Here is nginx version: nginx -V nginx version: nginx/1.6.0 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) TLS SNI support enabled configure arguments: --add-module=ngx_devel_kit-0.2.19 --add-module=lua-nginx-module-0.9.7 --add-module=memc-nginx-module-0.14 --user=apache --group=apache --prefi

Re: nginx rewrites $request_method on error

2014-05-13 Thread kay
Yichun Zhang (agentzh) Wrote: --- > Hello! > > On Wed, May 7, 2014 at 8:59 PM, kay wrote: > >> 1. It is not recommended to use the rewrite_by_lua directive > directly > > > > You can do the same with access_by_

Re: nginx rewrites $request_method on error

2014-05-07 Thread kay
> 1. It is not recommended to use the rewrite_by_lua directive directly You can do the same with access_by_lua > Finally, ensure your version of ngx_lua, ngx_memc, and the nginx core are recent enough. They are recent. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249754,249921#msg-

Re: nginx rewrites $request_method on error

2014-05-06 Thread kay
Sure, you can use nginx.conf from my previous message and this server config: server { listen 80; rewrite_by_lua ' local res = ngx.location.capture("/memc?cmd=get&key=test") ngx.say(res.body) '; location / { root /etc/nginx/www; } location /memc { internal;

Re: nginx rewrites $request_method on error

2014-05-06 Thread kay
Actually I suppose that this is a bug, as it is not possible to make filter by $request_method Also some external modules like https://github.com/openresty/memc-nginx-module have strange behavior when client passes TRACE and nginx gets GET. Posted at Nginx Forum: http://forum.nginx.org/read.php?

Re: nginx rewrites $request_method on error

2014-04-30 Thread kay
nginx from official repository: nginx -V nginx version: nginx/1.6.0 built by gcc 4.7.2 (Debian 4.7.2-5) TLS SNI support enabled configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/

nginx rewrites $request_method on error

2014-04-30 Thread kay
user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid/var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; # LET'S LOG $request_method # log_format main '$r

Re: Dynamic upstream proxy_pass

2014-04-09 Thread kay
My bad, in one location I forgot to remove port, that is why nginx tried to resolve upstream as hostname. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,249142,249145#msg-249145 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/

Dynamic upstream proxy_pass

2014-04-09 Thread kay
I'm trying to set upstream names by variables, but nginx recognizes variables as hostnames, not upstream names. For example: map $cookie_backend $proxy_host { default 'backend1'; '1' 'backend2'; } ... ... ... upstream backend1 { server backend123:8080; server backen

Re: Migrating existing Apache config

2013-05-08 Thread Kay Hayen
eally worth it. But I think I am sold on trying it out anyway, and will learn how to do things then. Lets see, how that works out. Yours, Kay ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Migrating existing Apache config

2013-05-08 Thread Kay Hayen
it's possible, I would welcome pointers... thanks in advance! Yours, Kay ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx