Nginx config issue: getting 403 Forbidden

Asked
Active3 hr before
Viewed126 times

6 Answers

nginxgettingconfigissue
90%

I've looked at Nginx 403 forbidden for all files but that didn't help. , Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers ,I encountered similar error --- "403 Forbidden" in the webpage --- "13: Permission denied" in the error log at /var/log/nginx/error.log ,to find where is nginx configuration file

If you have directory indexing off, and is having this problem, it's probably because the try_files you are using has a directory option:

location / {
   try_files $uri $uri / /index.html index.php;
} ^ that is the issue

Remove it and it should work:

location / {
   try_files $uri / index.html index.php;
}
load more v
88%

I Need Help To Download A MemoryHackers Download Sector Because I Can Not Download Because A 403 Forbidden nginx,DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand., Write for DigitalOcean You get paid, we donate to tech non-profits. , Write for DigitalOcean You get paid, we donate to tech non-profits.

This is the step that I’ve done and it’s work:

sudo chown - R www - data: www - data / usr / share / nginx / html
/*
sudo chmod -R 0755 /usr/share/nginx/html/*
72%

The index page has been corrupted or renamed with a different name.,The index page is located in a directory for which the auto index parameter is off.,The files that need to be loaded have incorrect file permissions.,When it comes to the reasons on the website administrators’ side, the reasons why an Nginx 403 Forbidden error is issued are different:

  • The index page has been corrupted or renamed with a different name.
  • The index page is located in a directory for which the auto index parameter is off.
  • The files that need to be loaded have incorrect file permissions.
  • The file is in an incorrect format.
  • You experience an error when trying to update the DNS cache by changing the host.
  • Incorrect .httacess configuration or in another configuration file from the server.

The main Nginx configuration file is /etc/nginx/nginx.conf
Nginx error log Location: /var/log/nginx/error.log

/etc/nginx / nginx.conf
  • The index page has been corrupted or renamed with a different name.
  • The index page is located in a directory for which the auto index parameter is off.
  • The files that need to be loaded have incorrect file permissions.
  • The file is in an incorrect format.
  • You experience an error when trying to update the DNS cache by changing the host.
  • Incorrect .httacess configuration or in another configuration file from the server.

The main Nginx configuration file is /etc/nginx/nginx.conf
Nginx error log Location: /var/log/nginx/error.log

/var/log / nginx / error.log
load more v
65%

The error below is generally caused by incorrect Unix permissions, you will need to make sure you have the correct permissions for the entire path.,The error below can be caused by two different reasons: incorrect directory index or disallowed directory listing.,Once you have the correct error log file, it’s time to watch for errors. In our experience, the best way to do this is by running a continuous stream of the error log in your shell screen using the tail utility.,If you know exactly where the error logs of your Nginx server are, you can skip onto the next section. If you’re not sure where to find the error logs of your Nginx server, then be sure to continue this section.

The first step of this is to check for the process ID of the main Nginx process, you can run the following command and except output somewhat similar to the one indicated below:

$ ps x | grep nginx
29229 ? S 0 : 00 nginx: master process / usr / sbin / nginx
load more v
75%

http://serverfault.com/questions/416787/nginx-403-forbidden-error-hosting-in-user-home-directory,You can give your user directory these permissions by running,You may also use 755, which is the default permission setting on the home directory on many systems.,I read the solution of the nginx return 403 error even when permission is correct here

nginx - v
nginx version: nginx / 1.0 .15
uname - a
Linux ampedservice 2.6 .32 - 279. el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
cat /proc/version 
Linux version 2.6.32-279.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) # 1 SMP Fri Jun 22 12: 19: 21 UTC 2012
rake about
MANUAL_GC is enable...
   About your application 's environment
Ruby version 1.9 .3(x86_64 - linux)
RubyGems version 1.8 .25
Rack version 1.4
Rails version 3.2 .14
Action Pack version 3.2 .14
Active Resource version 3.2 .14
Action Mailer version 3.2 .14
Active Support version 3.2 .14
Application root / home / gxdevelop / dev / ampedservice
load more v
40%

One major cause of Nginx 403 error is the incorrect file permissions.,By default, the standard permission for the directory is 755 and that of the file is 644.,The major causes of this error are incorrect settings in the index file and wrong file permissions.,Similarly, we go to the directory and change the permissions of all the files using the following command.

We change the ownership of all the files to the Nginx user with the command,

sudo chown - R nginx: nginx *
load more v

Other "nginx-getting" queries related to "Nginx config issue: getting 403 Forbidden"