I did some encoding to get the nginx configuration file.
My goal is to allow all folders .well-knownand subfolders to leave the rest with basic auth, limit_req and laravel compatibles.
Now the problem with Encrypt is that it does not renew the certificate, because the route .well-known/acme-challenge/wPCZZWAN8mlHLSQWr7ASZrJ_Tbk71g2Cd_1tPAv2JXMrequests permission, possibly affectedlocation ~ \.php$
So the question is: can I integrate one solo function? for example. ~ / and \.php$ \.(?!well-known).*And if so, can I combine the code together?
location ~ /\.(?!well-known).* {
limit_req zone=admin burst=5 nodelay;
limit_req_status 503;
try_files $uri $uri/ /index.php?$query_string;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}
source
share