nginx: add restricted location for users

This commit is contained in:
creme 2021-07-07 09:38:49 +00:00
parent 776f9f93a5
commit 38143fde53
2 changed files with 10 additions and 1 deletions

View File

@ -99,7 +99,7 @@ server {
}
# maubot
location /_matrix/maubot/v1/logs {
location ^~ /_matrix/maubot/v1/logs {
# location /_matrix/maubot {
include proxy_params;
proxy_ssl_name $http_host;
@ -135,6 +135,10 @@ server {
fastcgi_param SCRIPT_FILENAME /home/$user/public_html$request_filename;
}
location ~ /restricted/ {
auth_basic "Restricted Area";
auth_basic_user_file /home/$user/.htpasswd;
}
}
location ~* /\.(eot|ttf|woff|woff2)$ {

View File

@ -21,6 +21,11 @@ location ~ (\.cgi|\.py|\.sh|\.pl|\.lua|\/cgi-bin)$ {
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ~ /restricted/ {
auth_basic "Restricted Area";
auth_basic_user_file /home/$user/.htpasswd;
}
if (!-d /home/$user/public_html) {
return 307 https://envs.net/;
}