diff options
author | Mark Longair <mhl@pobox.com> | 2012-10-02 17:50:20 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2012-10-03 09:57:27 +0100 |
commit | 7f88f5c55adb98d28ff6f5a12732875f0a52cd93 (patch) | |
tree | a96a9aa5bed246994390b31aa6906903121b3316 | |
parent | 423e5a6129d96a608bd3d1f876f069cf2eedc490 (diff) |
Password-protect the admin interface and make an empty password file
-rwxr-xr-x | bin/pre-install-as-root | 2 | ||||
-rw-r--r-- | conf/nginx.conf.example | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/bin/pre-install-as-root b/bin/pre-install-as-root index 7ba759fd2..8d4c9dd26 100755 --- a/bin/pre-install-as-root +++ b/bin/pre-install-as-root @@ -275,6 +275,8 @@ install_nginx install_website_packages "$REPOSITORY" +su -l -c "touch '$DIRECTORY/admin-htpasswd'" "$UNIX_USER" + add_website_to_nginx "$UNIX_USER" "$HOST" "$REPOSITORY" add_postgresql_user "$UNIX_USER" diff --git a/conf/nginx.conf.example b/conf/nginx.conf.example index c356da887..7b26afdbf 100644 --- a/conf/nginx.conf.example +++ b/conf/nginx.conf.example @@ -49,6 +49,12 @@ server { proxy_set_header X-Real-IP $remote_addr; } + location /admin { + auth_basic "FixMyStreet admin interface"; + auth_basic_user_file /var/www/fixmystreet/admin-htpasswd; + try_files $uri @catalyst; + } + location / { if (-f $document_root/down.html) { return 503; |