Nginx forbidden SELinux

Nginx forbidden SELinux:

#allow nginx to access filesystem
sudo setsebool -P httpd_read_user_content 1

#change path context
ls -Z /path/to/dir
chcon -R -t httpd_sys_content_t /path/to/dir

#make the change permanent
semanage fcontext -a -t httpd_sys_content_t '/path/to/dir(/.*)?'
restorecon -Rv /path/to/dir

#To enable serving files from FUSE mounts, you can use:
setsebool httpd_use_fusefs 1
#To enable serving files from NFS mounts, you can use:
setsebool httpd_use_nfs 1


#for testing purpose only you can stop the selinux for a while to check if it's the source of your problems
setenforce 0