From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: nginx et .htaccess Date: Fri, 04 May 2018 18:14:09 +0200 Message-ID: <87r2mrflf2.fsf@lassieur.org> References: <20180504132914.GA3059@jurong> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEdLd-0006s3-Vg for help-guix@gnu.org; Fri, 04 May 2018 12:14:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEdLZ-0002Nj-1S for help-guix@gnu.org; Fri, 04 May 2018 12:14:17 -0400 Received: from mail.lassieur.org ([83.152.10.219]:53168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fEdLY-0002Lo-Me for help-guix@gnu.org; Fri, 04 May 2018 12:14:12 -0400 In-reply-to: <20180504132914.GA3059@jurong> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Andreas Enge Cc: help-guix@gnu.org Hi Andreas, Andreas Enge writes: > Hello, > > I would like to set up a web server with a password (only one user and > the associated password), in the same way as the .htaccess file does for > apache. > > When looking on the web, there are examples how to do this with Ubuntu etc., > by adding a file somewhere to /etc (with the hashed password) and editing a > line in the configuration file. > > Does our nginx configuration allow us to do the same? I do the same with my nginx configuration: (nginx-server-configuration (listen '("443 ssl" "[::]:443 ssl")) (server-name (list "foo.org")) (root "/var/www/foo") (locations (list (nginx-location-configuration (uri "/") (body (list "index index.html;" "auth_basic \"closed site\";" ;; needs to be set manually "auth_basic_user_file /etc/nginx/htpasswd;"))))) (ssl-certificate ...) (ssl-certificate-key ...)) /etc/nginx/htpasswd may contain: user: (I don't remember how to generate that hashed password.) Clément