37 reputation
8
bio website stackoverflow.com/users/…
location
age
visits member for 1 year, 11 months
seen Aug 20 at 4:05

Aug
20
awarded  Suffrage
Aug
20
answered Nginx Server Block Port 8081 Path to Root Folder
Aug
20
comment Nginx Password Protect Directory Downloads Source Code
Rather, it has fixed two big headaches for me--this one and this one. Thanks.
Aug
20
awarded  Commentator
Aug
20
comment Nginx Password Protect Directory Downloads Source Code
Thank, this fixed it and has ended a big headache for me!
Aug
20
accepted Nginx Password Protect Directory Downloads Source Code
Aug
20
answered Nginx ignores HTTP Authentication for WordPress login directory
Aug
20
comment Nginx Password Protect Directory Downloads Source Code
@Mike, thanks, I've now posted the entire configuration file.
Aug
20
revised Nginx Password Protect Directory Downloads Source Code
Added entire contents of configuration file
Aug
20
asked Nginx Password Protect Directory Downloads Source Code
Aug
19
comment Nginx Server Block Port 8081 Path to Root Folder
Thanks. However, when I go to example.com:8081, I get "400 Bad Request The plain HTTP request was sent to HTTPS port". Doesn't that mean that SSL is enabled? The SSL version, example.com:8081, displays fine. It is only when I try going to example.com:8081/phpmyadmin that I get a "404 Not Found" page.
Aug
18
asked Nginx Server Block Port 8081 Path to Root Folder
Aug
18
comment Nginx Password Protect Entire Port Number 8081
I suppose Nathan's code is correct for what I asked. I've been tinkering with it ever since and it seems like I'm experiencing another issue which is due to the root path settings being incorrect, although I'm still trying to figure it out. I suppose it will be more fitting for me to open a separate question for that issue since it is different. Thanks.
Aug
18
accepted Nginx Password Protect Entire Port Number 8081
Aug
16
comment Nginx Password Protect Entire Port Number 8081
Thanks @TeroKilkanen. I changed the permission for the htpasswd file to 644, but now after entering in the correct credentials, I get a "500 Internal Server Error" page. This is what's in the Nginx error log: "[crit] 32075#0: *1 crypt_r() failed (22: Invalid argument)". It seems this issue should have been fixed in a previous Nginx version--1.3.10: "Bugfix: "crypt_r() failed" errors might appear if the "auth_basic" directive was used on Linux." My username and password are both less than 8 characters long. Any ideas what I'm doing wrong?
Aug
15
comment Nginx Password Protect Entire Port Number 8081
@masegaloeh, I've updated my question accordingly.
Aug
15
revised Nginx Password Protect Entire Port Number 8081
added 758 characters in body
Aug
15
comment Nginx Password Protect Entire Port Number 8081
Another note--when I go to domain.com:8081 (SSL), this brings up the prompt for a username and password, as described above; however, when I go to domain.com:8081 (non-SSL), I simply get "400 Bad Request The plain HTTP request was sent to HTTPS port"
Aug
15
comment Nginx Password Protect Entire Port Number 8081
Thanks for the quick, helpful answer. This now brings up the prompt for a username and password (as does the suggestion of @AlexeyTen). However, when I input the correct credentials, it takes me to a "500 Internal Server Error" page. I made sure the permission is correct for my htpasswd file (711). Any idea how to fix this?
Aug
15
asked Nginx Password Protect Entire Port Number 8081