# Basic Auth - MySQL/PgSQL Backend

**URL:** <https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315>\
**Category:** NGINX\
**Created:** [May 23, 2011, 6:13pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315 "2011-05-23T18:13:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 23, 2011, 6:13pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/1 "2011-05-23T18:13:56Z")

</div>

I was wondering what options are available for using BasicAuth using  
Either MySQL or PostGres backend to store users.

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [May 23, 2011, 6:49pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/2 "2011-05-23T18:49:50Z")

</div>

Hi,

> I was wondering what options are available for using BasicAuth using  
> Either MySQL or PostGres backend to store users.

You can do this with ngx\_http\_auth\_request [1] with either ngx\_drizzle  
[2]  
(for Drizzle/MariaDB/MySQL/Percona) or ngx\_postgres [3] (for  
PostgreSQL).

Working example for ngx\_postgres is available in its README (Sample  
configuration #4).

[1] [ngx\_http\_auth\_request\_module: log](http://mdounin.ru/hg/ngx_http_auth_request_module/)  
[2] [GitHub - openresty/drizzle-nginx-module: an nginx upstream module that talks to mysql and drizzle by libdrizzle · GitHub](https://github.com/chaoslawful/drizzle-nginx-module)  
[3] [GitHub - FRiCKLE/ngx\_postgres: upstream module that allows nginx to communicate directly with PostgreSQL database. · GitHub](https://github.com/FRiCKLE/ngx_postgres)

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [May 23, 2011, 6:56pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/3 "2011-05-23T18:56:01Z")

</div>

Thanks.

I didnt see the example in the README?  
Sample #4?

Thanks Again.

David.

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [May 23, 2011, 7:06pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/4 "2011-05-23T19:06:31Z")

</div>

Hi,

> I didnt see the example in the README?  
> Sample #4?

Then look again, it’s there.

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [May 23, 2011, 7:09pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/5 "2011-05-23T19:09:36Z")

</div>

I am not sure which readme you are referring to;

I see your name is listed here;

> **[GitHub - openresty/drizzle-nginx-module: an nginx upstream module that talks...](https://github.com/openresty/drizzle-nginx-module)**
>
> an nginx upstream module that talks to mysql and drizzle by libdrizzle - GitHub - openresty/drizzle-nginx-module: an nginx upstream module that talks to mysql and drizzle by libdrizzle

Is this the file you are talking about?

Thanks.

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [May 23, 2011, 7:20pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/6 "2011-05-23T19:20:08Z")

</div>

Hi,

> I am not sure which readme you are referring to;

“Working example for ngx\_postgres is available in its README (Sample  
configuration #4).” should be self-explanatory 😉

> I see your name is listed here;
> 
> [GitHub - openresty/drizzle-nginx-module: an nginx upstream module that talks to mysql and drizzle by libdrizzle · GitHub](https://github.com/chaoslawful/drizzle-nginx-module)

I’m listed in the other one as well.

> Is this the file you are talking about?

Nope, I’m talking about ngx\_postgres’s one.

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [May 23, 2011, 7:22pm UTC](https://www.ruby-forum.com/t/basic-auth-mysql-pgsql-backend/207315/7 "2011-05-23T19:22:38Z")

</div>

Thanks.

I really appreciate it;

That (surprisingly!) was the only one I didnt look at.

Thanks again.
