0

please, I have a react js application that I want to deploy on my server (Centos 7), I have already generated the build and I have installed nginx on my server and I have created the folder www under /var/ where I have put the content of my build following the path : /var/www/merchant-dashboard/html.

enter image description here

and I have already allocated the 777 permissions for the www folder and all its subdirectories and files

enter image description here

I created my configuration file under /etc/nginx/conf.d and named it merchantDashboard.conf here is its content :

enter image description here.

I have also set the permissions for the nginx user with the command sudo chown -R nginx:nginx *. (my user is called nginx) but I still get the 403 forbidden error. Here is my error logs :

enter image description here

if someone can help me please

Amine Ch 99
  • 145
  • 3
  • 14

1 Answers1

0

I followed this answer: Why does Nginx return a 403 even though all permissions are set properly?

When I disabled SELinux it worked.

Following command from the above mentioned link solved the problem: chcon -Rt httpd_sys_content_t /path/to/www

Apurva Mayank
  • 721
  • 2
  • 12
  • 32
Amine Ch 99
  • 145
  • 3
  • 14