* nginx et .htaccess
@ 2018-05-04 13:29 Andreas Enge
2018-05-04 16:14 ` Clément Lassieur
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Enge @ 2018-05-04 13:29 UTC (permalink / raw)
To: help-guix
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?
Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nginx et .htaccess
2018-05-04 13:29 nginx et .htaccess Andreas Enge
@ 2018-05-04 16:14 ` Clément Lassieur
2018-07-08 15:45 ` Andreas Enge
0 siblings, 1 reply; 4+ messages in thread
From: Clément Lassieur @ 2018-05-04 16:14 UTC (permalink / raw)
To: Andreas Enge; +Cc: help-guix
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nginx et .htaccess
2018-05-04 16:14 ` Clément Lassieur
@ 2018-07-08 15:45 ` Andreas Enge
2018-07-08 16:27 ` Clément Lassieur
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Enge @ 2018-07-08 15:45 UTC (permalink / raw)
To: Clément Lassieur; +Cc: help-guix
Hello Clément,
I think I never replied to your kind e-mail, apologies!
On Fri, May 04, 2018 at 06:14:09PM +0200, Clément Lassieur wrote:
> 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>
This worked well, indeed, thanks a lot! It did not even occur to me that
I could store state somewhere on the machine and use it in my operating
system declaration...
Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: nginx et .htaccess
2018-07-08 15:45 ` Andreas Enge
@ 2018-07-08 16:27 ` Clément Lassieur
0 siblings, 0 replies; 4+ messages in thread
From: Clément Lassieur @ 2018-07-08 16:27 UTC (permalink / raw)
To: Andreas Enge; +Cc: help-guix
I'm glad it works Andreas!
Clément
Andreas Enge <andreas@enge.fr> writes:
> Hello Clément,
>
> I think I never replied to your kind e-mail, apologies!
>
> On Fri, May 04, 2018 at 06:14:09PM +0200, Clément Lassieur wrote:
>> 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>
>
> This worked well, indeed, thanks a lot! It did not even occur to me that
> I could store state somewhere on the machine and use it in my operating
> system declaration...
>
> Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-08 16:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-04 13:29 nginx et .htaccess Andreas Enge
2018-05-04 16:14 ` Clément Lassieur
2018-07-08 15:45 ` Andreas Enge
2018-07-08 16:27 ` Clément Lassieur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).