bitly / oauth2_proxy

A reverse proxy that provides authentication with Google, Github or other provider
MIT License
5.1k stars 1.21k forks source link

Question: About architectural deploy and HA #588

Closed ghost closed 6 years ago

ghost commented 6 years ago

hi,

i have maybe 2 question.

  1. Should i have one oauth2 proxy process per application? or could i have just one and redirect to more than one app.

  2. any way to have oauth2 proxy LB setup?

Thanks in advance

ploxiln commented 6 years ago

oauth2_proxy is stateless - if you configure two instances of oauth2_proxy with the same cookie-name, cookie-secret, oauth client secret, etc, then you can put them on two separate servers behind a load balancer and it will be transparent.

If your applications just have different paths but the same domain then it's pretty easy to put multiple of them behind an oauth2_proxy. Things get complicated and tricky when you try to do this for apps on different domains. One reason is because of the oauth callback restrictions enforced by the oauth provider. There is a lot you can do with complicated and clever nginx config. But often having separate instances of oauth2_proxy per app domain is the simplest and most robust way.

ghost commented 6 years ago

Thank you very much for ur answer