- I have Nginx installed with PHP-FPM ( php 7.2) on a CentOS 7
- I created a new account with name deploy
- I added deploy to group deploy, added deploy to group Nginx
- I created a folder in deploy's home web/public, then set permission
777 -R web/public/
- then I changed
user = deploy
,group = deploy
in/etc/opt/remi/php72/php-fpm.d/www.conf
- SELinux disabled
My problem is: - I can run php, but cannot access static file ( css, js... ) via browser
This is an error message:
- 19/04/27 22:51:22 [error] 4165#0: *1601 open() "/home/deploy/web/public/robots.txt" failed (13: Permission denied), client: 216.244.66.xxx, server: _, request: "GET /robots.txt HTTP/1.1", host: "domain.com"
This is Nginx setting
server {
listen 80;
server_name domain.con;
root /home/deploy/web/public;
index index.html index.php;
error_log /var/logs/nginx/error_log error;
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
root /home/deploy/web/public;
autoindex on;
access_log on;
expires max;
log_not_found on;
}
Please help me
Update, solution is:
chmod +x /home/deploy
chmod +x /home/deploy/public