Failed to load resource: the server responded with a status of 403 forbidden nginx

Find out the web server user

open up terminal and type lsof -i tcp:80

This will show you the user of the web server process Here is an example from a raspberry pi running debian:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME apache2 7478 www-data 3u IPv4 450666 0t0 TCP *:http (LISTEN) apache2 7664 www-data 3u IPv4 450666 0t0 TCP *:http (LISTEN) apache2 7794 www-data 3u IPv4 450666 0t0 TCP *:http (LISTEN)

The user is www-data

If you give ownership of the web files to the web server:

chown www-data:www-data -R /opt/lamp/htdocs

And chmod 755 for good measure:

chmod 755 -R /opt/lamp/htdocs

Let me know how you go, maybe you need to use 'sudo' before the command, i.e. sudo chown www-data:www-data -R /opt/lamp/htdocs

if it doesn't work, please give us the output of: ls -al /opt/lamp/htdocs

Blocked from a site? If the issue is on your side, you can (probably) resolve it

The 403 Forbidden error is an HTTP status code that means that access to the page or resource you were trying to reach is blocked for some reason.

What Causes 403 Forbidden Errors

Different web servers report 403 Forbidden errors in different ways, the majority of which we've listed below (see the Common 403 Error Messages section). Occasionally a website owner will customize the site's error, but that's not too common.

These errors are caused by issues where you're trying to access something that you don't have permission for. The error is essentially saying "Go away and don't come back here" because the server's access permissions indicate that you’re truly not allowed access or the permissions are actually improperly set up and you’re being denied access when you shouldn’t be.

How to Fix the 403 Forbidden Error

Different website designs can produce 403 errors that might make them seem different from site to site but, overall, they are pretty much the same thing. Often, there's not much you can do because the error typically stems from the development and design of the site.

Occasionally, though, it could be a problem on your end. Here are a few things to try so you can confirm it's not your side of the connection causing the problem.

  1. Check for URL errors and make sure you're specifying an actual web page file name and extension, not just a directory. Most websites are configured to disallow directory browsing, so a 403 Forbidden message when trying to display a folder instead of a specific page, is normal and expected.

    This is, by far, the most common reason for a website to return the 403 Forbidden error. Be sure you fully explore this possibility before investing time in the troubleshooting below.

    If you operate the website in question, and you want to prevent 403 errors in these cases, enable directory browsing in your web server software.

  2. Clear your browser's cache. Issues with a cached version of the page you're viewing could be causing 403 Forbidden issues.

  3. Log in to the website, assuming it's possible and appropriate to do so. The error message could mean that you need additional access before you can view the page.

    Typically, a website produces a 401 Unauthorized error when special permission is required, but sometimes a 403 Forbidden is used instead.

  4. Clear your browser's cookies, especially if you typically log in to this website and logging in again (the last step) didn't work.

    Be sure to enable cookies in your browser, or at least for this website if you do actually log in to access this page. The 403 Forbidden error, in particular, indicates that cookies might be involved in obtaining proper access.

  5. Contact the website directly. It's possible that the 403 error is a mistake, everyone else is seeing it, too, and the website isn't yet aware of the problem.

    Most sites have support-based accounts on social networking sites, making it really easy to get a hold of them. Some even have support email addresses and telephone numbers.

    How to Tell If a Website Is Down for Everyone or Just You

  6. Contact your internet service provider if you're still getting the 403 error, especially if you're pretty sure that the website in question is working for others right now.

    It's possible that your public IP address, or your entire ISP, has been added to a blocklist, a situation that could produce this error, usually on all pages on one or more sites. If that's the case, and your ISP can't help you, connecting to a VPN server from a region of the world that does permit access, should be enough to resolve the error.

  7. Come back later. Once you've verified that the page you're accessing is the correct one and that the HTTP error is being seen by more than just you, just revisit the page on a regular basis until the problem is fixed.

How the 403 Error Can Appear on Different Sites

These are the most common incarnations of 403 Forbidden errors:

  • 403 Forbidden
  • HTTP 403
  • Forbidden: You don't have permission to access [directory] on this server
  • Forbidden
  • Error 403
  • HTTP Error 403.14 - Forbidden
  • Error 403 - Forbidden
  • HTTP Error 403 - Forbidden

The error displays inside the browser window, just as web pages do, and like all errors of this type, it can be seen in any browser on any operating system.

These errors, when received while opening links via Microsoft Office programs, generate the message Unable to open [url]. Cannot download the information you requested inside the Office software.

Windows Update might also report an HTTP 403 error but it will display as error code 0x80244018 or with the following message: WU_E_PT_HTTP_STATUS_FORBIDDEN.

Microsoft IIS web servers provide more specific information about the cause of 403 Forbidden errors by suffixing a number after the 403, as in HTTP Error 403.14 - Forbidden, which means Directory listing denied.

Similar Errors to 403 Forbidden

The following messages are also client-side errors and so are related to the 403 Forbidden error: 400 Bad Request, 401 Unauthorized, 404 Not Found, and 408 Request Timeout.

Several server-side HTTP status codes also exist, like the popular 500 Internal Server Error, among others that you can find in our list of HTTP status code errors.

FAQ

  • What does HTTP stand for?

    HTTP stands for HyperText Transfer Protocol. It's the network protocol used by the World Wide Web that lets you open web page links and jump from one page to the next across search engines and other websites.

  • What does HTTP error 400 mean?

    The 400 Bad Request error is an HTTP status code meaning the request you sent to the website server, often something simple like a request to load a web page, was somehow incorrect or corrupted and the server couldn't understand it. The error is often caused by entering or pasting the wrong URL in the address window.

Thanks for letting us know!

How do you fix 403 forbidden access to this resource on the server is denied?

In this post, we looked at five main ways you can fix the 403 Forbidden error using an SFTP client like FileZilla or the file manager in your hosting account: Change your file permissions. Deactivate your plugins. Delete and restore the .

What are the reasons for 403 forbidden?

The 403 Forbidden Error happens when the web page (or another resource) that you're trying to open in your web browser is a resource that you're not allowed to access. It's called a 403 error because that's the HTTP status code that the webserver uses to describe that kind of error.

How do I fix Nginx error?

Basic Nginx troubleshooting.
Search for syntax errors or warnings in the configuration. ... .
Check that Nginx is running. ... .
Verify that the ports are open and the service is listening. ... .
Check if Nginx processes requests. ... .
Check the logs. ... .
Check permissions. ... .
Reload the service. ... .
Enable de debug mode..