Nginx Server Block Port 8081 Path to Root Folder
Posted
by
Pamela
on Server Fault
See other posts from Server Fault
or by Pamela
Published on 2014-08-18T20:00:30Z
Indexed on
2014/08/20
4:23 UTC
Read the original article
Hit count: 491
I'm trying to password protect all of port 8081 on my Nginx server. The only thing this port is used for is PhpMyAdmin. When I navigate to https://www.example.com:8081, I successfully get the default Nginx welcome page. However, when I try navigating to the PhpMyAdmin directory, https://www.example.com:8081/phpmyadmin, I get a "404 Not Found" page.
Permission for my htpasswd file is set to 644.
Here is the code for my server block:
server {
listen 8081;
server_name example.com www.example.com;
root /usr/share/phpmyadmin;
auth_basic "Restricted Area";
auth_basic_user_file htpasswd;
}
I have also tried entirely commenting out #root /usr/share/phpmyadmin; However, it doesn't make any difference.
Is my problem confined to using the incorrect root path? If so, how can I find the root path for PhpMyAdmin?
If it makes any difference, I'm using Ubuntu 14.04.1 LTS with Nginx 1.4.6 and ISPConfig 3.0.5.4p3.
© Server Fault or respective owner