Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Nginx and Password Protecting Directories

xaitmixaitmi Member

Hi. I placed this file inside the folder I want password protected as .htaccess

# nginx configuration
auth_basic "Restricted Area";
auth_basic_user_file /home/nginx/domains/mydomain.com/private/.htpasswd;

But when I go to that page it does not request me to enter the details stored in .htpasswd.

I even tried restarting nginx.

Anyone know what I am doing wrong?

Comments

  • Have you set up Nginx in such a way that it will load .htaccess files like that?

    .htaccess is an Apache concept, so unless you have configured Nginx to, it's not going to read any .htaccess files.

    Thanked by 1xaitmi
  • xaitmixaitmi Member
    edited April 2015

    @Detruire said:
    Have you set up Nginx in such a way that it will load .htaccess files like that?

    .htaccess is an Apache concept, so unless you have configured Nginx to, it's not going to read any .htaccess files.

    Nope. All I've done so far is install CentMinMod http://centminmod.com/

    I didn't know .htaccess was an only apache thing.

    Time to set this up http://kbeezie.com/protecting-folders-with-nginx/

  • Got it all working now.

    Thanks @Detruire

Sign In or Register to comment.