help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nginx et .htaccess


From: Clément Lassieur
Subject: Re: nginx et .htaccess
Date: Fri, 04 May 2018 18:14:09 +0200
User-agent: mu4e 1.0; emacs 25.3.1

Hi Andreas,

Andreas Enge <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]