I have this configuration:
location ~ /xxxxx {
alias /var/www/dir1/xxxxx/public;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param DOCUMENT_ROOT $realpath_root;
include fastcgi_params;
location ~ /xxxxx/image.png {
rewrite_log on;
rewrite ^(.*)$ /xxxxx/public/index.php;
}
}
It works, '/xxxxx/image.png' is shown in the browser.
But I also have an admin part in the public directory (public/admin/index.php), and I like to access it on the url: 'https://ift.tt/3bpQvoR' but for the moment I have a message from nginx : "Access denied." I tried several conf in the location block, but I don't find the right one.. It's always broken..
Do you have an idea? Thank you!
source https://stackoverflow.com/questions/69772616/nginx-configuration-with-public-directory
Comments
Post a Comment