Re: Nginx urgent query

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Nginx urgent query

Devika Awasthi
 Hi Team,

 

I have a question on Nginx open source.

So, we have a nginx web server being used as  kubernetes pod in production as reverse proxy and web layer.

We wanted to leverage the upstream hash module for session stickiness. We tried a POC  locally by recompiling the Nginx with additional module - http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash. and it worked well.

 

However for production and other higher environments wanted to know if we have any nginx docker image/container with above http upstream module please which can  pulled?

I tried searching in docker hub, couldn’t find any.

 

Any pointers would be highly helpful!

 

Thanks,

Devika


On Wed, Sep 19, 2018 at 6:29 PM Devika Awasthi <[hidden email]> wrote:

Hi Team,

 

I have a question on Nginx open source.

So, we have a nginx web server being used as  kubernetes pod in production as reverse proxy and web layer.

We wanted to leverage the upstream hash module for session stickiness. We tried a POC  locally by recompiling the Nginx with additional module - http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash. and it worked well.

 

However for production and other higher environments wanted to know if we have any nginx docker image/container with above http upstream module please which can  pulled?

I tried searching in docker hub, couldn’t find any.

 

Any pointers would be highly helpful!

 

Thanks,

Devika


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx urgent query

Maxim Dounin
Hello!

On Wed, Sep 19, 2018 at 06:40:11PM +0530, Devika Awasthi wrote:

> I have a question on Nginx open source.
>
> So, we have a nginx web server being used as  kubernetes pod in production
> as reverse proxy and web layer.
>
> We wanted to leverage the upstream hash module for session stickiness. We
> tried a POC  locally by recompiling the Nginx with additional module -
> http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash. and it
> worked well.
>
> However for production and other higher environments wanted to know if we
> have any nginx docker image/container with above http upstream module
> please which can  pulled?
>
> I tried searching in docker hub, couldn’t find any.

The ngx_http_upstream_module which provides the "hash" directive
is compiled in by default, unless explicitly switched off with the
"--without-http_upstream_hash_module" configure option.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx urgent query

Devika Awasthi
I didn't get full reply, Maxim,.. Could you please reply again.. 

On Wed 19 Sep, 2018, 11:53 PM Maxim Dounin, <[hidden email]> wrote:
Hello!

On Wed, Sep 19, 2018 at 06:40:11PM +0530, Devika Awasthi wrote:

> I have a question on Nginx open source.
>
> So, we have a nginx web server being used as  kubernetes pod in production
> as reverse proxy and web layer.
>
> We wanted to leverage the upstream hash module for session stickiness. We
> tried a POC  locally by recompiling the Nginx with additional module -
> http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash. and it
> worked well.
>
> However for production and other higher environments wanted to know if we
> have any nginx docker image/container with above http upstream module
> please which can  pulled?
>
> I tried searching in docker hub, couldn’t find any.

The ngx_http_upstream_module which provides the "hash" directive
is compiled in by default, unless explicitly switched off with the
"--without-http_upstream_hash_module" configure option.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx urgent query

Devika Awasthi
In reply to this post by Maxim Dounin
Many Thanks Maxim,

But we did try to achieve the functionality by using - nginx=1.10.3-r1, we couldn't get request based session stickiness.
Basically we want the requests with identical query params to hit the same instance everytime.

By recompiling again with this module and using below config it worked:

upstream load_balancer { hash $scheme$proxy_host$request_uri$is_args$args consistent; server 127.0.0.1:9003; server 127.0.0.1:9004; } server { listen 8081; server_name localhost; access_log /usr/local/var/log/nginx/access.log;
location / { proxy_pass http://load_balancer }
Do you think we are missing anything here?

Thanks,
Devika

On Wed, Sep 19, 2018 at 11:53 PM Maxim Dounin <[hidden email]> wrote:
Hello!

On Wed, Sep 19, 2018 at 06:40:11PM +0530, Devika Awasthi wrote:

> I have a question on Nginx open source.
>
> So, we have a nginx web server being used as  kubernetes pod in production
> as reverse proxy and web layer.
>
> We wanted to leverage the upstream hash module for session stickiness. We
> tried a POC  locally by recompiling the Nginx with additional module -
> http://nginx.org/en/docs/http/ngx_http_upstream_module.html#hash. and it
> worked well.
>
> However for production and other higher environments wanted to know if we
> have any nginx docker image/container with above http upstream module
> please which can  pulled?
>
> I tried searching in docker hub, couldn’t find any.

The ngx_http_upstream_module which provides the "hash" directive
is compiled in by default, unless explicitly switched off with the
"--without-http_upstream_hash_module" configure option.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx urgent query

Maxim Dounin
Hello!

On Thu, Sep 20, 2018 at 10:55:26AM +0530, Devika Awasthi wrote:

> Many Thanks Maxim,
>
> But we did try to achieve the functionality by using - nginx=1.10.3-r1, we
> couldn't get request based session stickiness.
> Basically we want the requests with identical query params to hit the same
> instance everytime.
>
> By recompiling again with this module and using below config it worked:
>
> upstream load_balancer { hash $scheme$proxy_host$request_uri$is_args$args
> consistent; server 127.0.0.1:9003; server 127.0.0.1:9004; } server { listen
> 8081; server_name localhost; access_log /usr/local/var/log/nginx/access.log;
> location / { proxy_pass http://load_balancer }
> Do you think we are missing anything here?

First of all you may want to define how do you expect it to work
and how do you test if it worked or not.

It also not clear what do you mean by "recompiling again with this
module".  As I already wrote, the module is compiled in by
default.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Nginx urgent query

wld75
In reply to this post by Devika Awasthi
Devika Awasthi Wrote:
-------------------------------------------------------
> Many Thanks Maxim,
>
> But we did try to achieve the functionality by using -
> nginx=1.10.3-r1, we
> couldn't get request based session stickiness.
> Basically we want the requests with identical query params to hit the
> same
> instance everytime.

Maybe this can help;
https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng

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

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx