I have a nginx server and all seems to work finde but when I add a auth for a directory the server returns the php code as download.
server {
listen 80 defau
nginx
processes a request by choosing a location. The new location
does not contain the necessary code to execute PHP. You should add a nested location block to process PHP within the /auth/
directory.
location ^~ /auth/ {
try_files $uri $uri/ =404;
auth_basic "Auth";
auth_basic_user_file /etc/nginx/.htpasswd;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
...
location ~ \.php$ { ... }