In a typical Laravel installation, the public
folder contains all of the publicly accessible files for the application. This includes the index.php
file, which is the entry point for all requests to the application. The public
folder is designed to be the document root of your web server, which means that all requests to your application should be routed to this folder. In this article, we will explain how to manipulate the Nginx Directives ISPconfig configuration for hosting Laravel apps.
For example, if your application is installed in a directory named myapp
under the document root of your web server, the URL for your application would typically be http://example.com/myapp/public
.
To set Nginx directives in ISPConfig for a Laravel application located under the public
folder, you can follow these steps:
- Login to your ISPConfig control panel.
- Go to the website for which you want to set the Nginx directives.
- Click on the “Options” tab.
- Scroll down to the “Nginx Directives” section.
- Enter the following directives in the text box provided:
location / {
root {DOCROOT}larav/public;
try_files $uri larav/public/$uri/ /larav/public/index.php?$query_string;
}
larav
= Our folder Apps.
This is screen capture Nginx Directives.
If we use apache for web server, we can follow this post Laravel htaccess Redirect to Sub Folder