<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ngnx on nagg.eu</title><link>https://nagg.eu/tags/ngnx/</link><description>Recent content in Ngnx on nagg.eu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 05 Mar 2014 11:26:24 +0000</lastBuildDate><atom:link href="https://nagg.eu/tags/ngnx/index.xml" rel="self" type="application/rss+xml"/><item><title>Nginx and password protected pages</title><link>https://nagg.eu/nginx-and-password-protected-pages/</link><pubDate>Wed, 05 Mar 2014 11:26:24 +0000</pubDate><guid>https://nagg.eu/nginx-and-password-protected-pages/</guid><description>&lt;p&gt;To password protect a directory &lt;code&gt;xyz&lt;/code&gt; and every file and subdirectory in it open the configuration file (nginx.conf or one of the virtual host configuration files) and add the following two lines:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;location /xyz/ {
 auth_basic &amp;#34;Restricted Area&amp;#34;;
 auth_basic_user_file conf.d/htpasswd;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;htpasswd file must be encrypted, it can be created using a tool named htpasswd.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@xenserver ~]# cd /etc/nginx/conf.d/
[root@xenserver ~]# htpasswd -b htpasswd user password
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>