coderaiser / cloudcmd

✨☁️📁✨ Cloud Commander file manager for the web with console and editor.
https://cloudcmd.io
MIT License
1.83k stars 257 forks source link

Nginx auth conflict #151

Closed kirtapix closed 6 years ago

kirtapix commented 6 years ago

Hi, Got a problem with basic authentication in Nginx and with in cloudcmd. When Auth is activated in Nginx, I get the popup to enter my credentials for Nginx but then everything is blocked and I get error 401 on every request for cloudcmd loading(seen in Firefox dev tool console). If I deactivate Auth in Nginx and clear cache, reload Nginx and cloudcmd, I got the popup for cloudcmd and it loads correctly. Seems that credentials for Nginx are used for cloudcmd by the webbrowser or something like that.

Thx in advance !

coderaiser commented 6 years ago

The thing is when you usenginx with http-auth it sets header status: 401 then gets username and password but if you not set header directly in proxy_set it would not send it to cloudcmd.

Also you can set field proxy_pass_request_headers as described here.

Is it helped?

kirtapix commented 6 years ago

Tried to add > more_set_input_headers 'Authorization: $http_authorization'; in my nginx conf file but it didn't helped. I need to recompile Nginx with More mod. Do you think it is possible to make a connection portal and put cloudcmd and my other web apps behind it ?

coderaiser commented 6 years ago

I think you can use proxy_set_header or proxy_pass_request_headers instead of more_set_input_headers.

What do you mean by connection portal?

kirtapix commented 6 years ago

Ok got it to work, now nginx auto anthenticate in cloudcmd, thanks for your help :). Sorry my english technical vocabulary is not as good as yours. I mean a front-end session manager, something like wwwhisper.

coderaiser commented 6 years ago

Glad to help :)