skip to Main Content

I followed this guide to set up my Laravel application with the exact same setup of the server. So basically, I have only changed the laravel application, the rest is the same.

When I access the ip_address in the browser my application redirects the users to ip_address/login page to log in, and I get a 403. The login.blade.php is located in laravel_root/resources/views/

In the nginx error.log I see “access forbidden by rule”.

I found somewhere as a solution to remove location ~ /.(?!well-known).* { deny all; }

from the nginx file. And it worked.

My question is what is the risk of this? Is there another more secure way to fix 403 without removing the deny all rule?

2

Answers


  1. Chosen as BEST ANSWER

    I have changed

    location ~ /.(?!well-known).* {
        deny all;
    }
    

    to

    location ~ /.(?!well-known).* {
            deny all;
        }
    

    and it worked. found the answer here


  2. Laravel has built in authentication through middlewares etc.

    As long as you point NGINX to the /public directory within Laravel this is a good starting point.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search