NGINX ERROR (403 Forbidden)

June 22, 2018 16k views
Nginx Ubuntu 16.04


Have this 403 error.
My website is developped with Laravel.


server {
listen defaultserver;
name localhost;
root /usr/share/nginx/html;
index public/index.php;

The index, is located on the folder public.
But when I goes to my site, I start download the index, but I didn’t see the index..
Have try with the view of the index located here
-> resources/views/main/main.blade.php

But, same error.

1 Answer

You have a few errors in your server block. Below is a corrected version. As it is a PHP:Laravel project you will need to add the necessary directives for NGINX to know how to interoperate PHP.

server {
  listen 8080;
  root /usr/share/nginx/html/public;
  index index.php index.html;

You can find info you need here.

by Justin Ellingwood
The LEMP software stack is a group of software that can be used to serve dynamic web pages and web applications. This is an acronym that describes a Linux operating system, with an Nginx web server. The backend data is stored in the MySQL database and the dynamic processing...
Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!