# Nginx reverse proxy with basic auth to secure login in Cells log in front end

**URL:** <https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367>\
**Category:** Pydio Cells\
**Tags:** authentication\
**Created:** [February 24, 2022, 6:02am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367 "2022-02-24T06:02:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hero](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hero](https://forum.pydio.com/u/Hero)\
**Post date:** [February 24, 2022, 6:02am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367/1 "2022-02-24T06:02:08Z")

</div>

Hello specialists,  
to convince my boss that Cells is the best product and we have to use it, I have to secure the native login from Cells’ login front end. My idea is to use nginx’s basic auth module with credentials (username/password) It works fine until the login page from Cells. If I put in the in Cells configured user credentials (username/password) I can’t log in with the hint **Unauthorized**. What can I do, that Cells accepts the input credentials?  
I think there was the same issue 2 years ago, but unfortunately with no answer.

> [@Pydio Cells with Nginx and password authentication](https://forum.pydio.com/t/pydio-cells-with-nginx-and-password-authentication/3576):
>
> Hey there, I’m running Pydio Cells on an vserver with ubuntu 20.04 LTS. Also I use on that server as reverse proxy nginx. Every works well. My problem is, when I activate a password authentification on the nginx, I can’t log into cells with the users. It results in the error: Unauthorized. I made a password protection with: auth\_basic “Password Required”; auth\_basic\_user\_file /etc/nginx/.htpasswd; in the ngnix config file. In the log of the nginx server I found this: user [Date] “POST /a…

Please, could someone help me?  
BR  
Jo

---

<div class="post-metadata">

**Author:** ![charles](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/charles/32/3_2.png) [@charles](https://forum.pydio.com/u/charles)\
**Post date:** [February 28, 2022, 8:33am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367/2 "2022-02-28T08:33:11Z")

</div>

Hello,  
This is probably messing up the Http Headers, as basic auth will conflict with Bearer token Authentication header. Maybe you can fiddle with upstream/downstream headers to make sure nginx does not strip the Cells authentication headers?  
-c

---

<div class="post-metadata">

**Author:** ![bsinou](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/bsinou/32/476_2.png) [@bsinou](https://forum.pydio.com/u/bsinou)\
**Post date:** [February 28, 2022, 9:44am UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367/3 "2022-02-28T09:44:07Z")

</div>

We just discussed this with the team:

- the nginx auth mechanism uses (overrides) the Auth Headers and thus breaks the normal OAuth process
- to achieve the same goals, you should rather:
  - use a VPN tunnel between your test machine and the reverse proxy.
  - put a firewall before your reverse proxy and filter out unwanted traffic

---

<div class="post-metadata">

**Author:** ![Hero](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hero](https://forum.pydio.com/u/Hero)\
**Post date:** [February 28, 2022, 12:03pm UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367/4 "2022-02-28T12:03:41Z")

</div>

Hi Charles,

thank you very much for your quick response and helpful hint as the developer confirmed the issued

BR  
Jo

---

<div class="post-metadata">

**Author:** ![Hero](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hero](https://forum.pydio.com/u/Hero)\
**Post date:** [February 28, 2022, 12:07pm UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367/5 "2022-02-28T12:07:10Z")

</div>

Hi,

thank you very much for the very quick answer and suggestions for solving my Problem

BR  
Jo

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/pydio/original/2X/6/61f19fa52ec15fd4250db51aea351adba0e831fd.png) [@system](https://forum.pydio.com/u/system)\
**Post date:** [March 11, 2022, 6:07pm UTC](https://forum.pydio.com/t/nginx-reverse-proxy-with-basic-auth-to-secure-login-in-cells-log-in-front-end/4367/6 "2022-03-11T18:07:58Z")

</div>

This topic was automatically closed 11 days after the last reply. New replies are no longer allowed.
