From: "Clément Lassieur" <clement@lassieur.org>
To: Andreas Enge <andreas@enge.fr>
Cc: help-guix@gnu.org
Subject: Re: nginx et .htaccess
Date: Fri, 04 May 2018 18:14:09 +0200 [thread overview]
Message-ID: <87r2mrflf2.fsf@lassieur.org> (raw)
In-Reply-To: <20180504132914.GA3059@jurong>
Hi Andreas,
Andreas Enge <andreas@enge.fr> 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:<hashed-pwd>
(I don't remember how to generate that hashed password.)
Clément
next prev parent reply other threads:[~2018-05-04 16:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 13:29 nginx et .htaccess Andreas Enge
2018-05-04 16:14 ` Clément Lassieur [this message]
2018-07-08 15:45 ` Andreas Enge
2018-07-08 16:27 ` Clément Lassieur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2mrflf2.fsf@lassieur.org \
--to=clement@lassieur.org \
--cc=andreas@enge.fr \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.