mirror of
https://github.com/linuxserver/docker-heimdall.git
synced 2025-10-27 11:13:41 +09:00
Use htpasswd if exists
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
## Version 2018/03/06 - Changelog: https://github.com/linuxserver/docker-heimdall/commits/master/root/defaults/default
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
|
|
||||||
@@ -13,10 +15,22 @@ server {
|
|||||||
|
|
||||||
client_max_body_size 0;
|
client_max_body_size 0;
|
||||||
|
|
||||||
|
if (-f /config/nginx/.htpasswd) {
|
||||||
|
return 599;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.php?$args;
|
try_files $uri $uri/ /index.php?$args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error_page 599 = @htpasswd;
|
||||||
|
|
||||||
|
location @htpasswd {
|
||||||
|
auth_basic "Restricted";
|
||||||
|
auth_basic_user_file /config/nginx/.htpasswd;
|
||||||
|
try_files $uri $uri/ /index.php?$args;
|
||||||
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
# With php5-cgi alone:
|
# With php5-cgi alone:
|
||||||
|
|||||||
Reference in New Issue
Block a user