Created
August 10, 2023 10:42
-
-
Save kalair92/b75bb9144e128365f84e0a9d479c2b6e to your computer and use it in GitHub Desktop.
Nginx configuration for Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *projectname* Change the name as per your desired project directory | |
server { | |
listen 80; | |
server_name localhost; | |
root /var/www/*projectname*/public; #root_path | |
index index.php; | |
charset utf-8; | |
location / { | |
try_files $uri $uri/ /index.php?_url=$uri&$args; | |
} | |
location ~ \.php { | |
fastcgi_pass unix:/run/php/php7.4-fpm.sock; | |
fastcgi_index /index.php; | |
include fastcgi_params; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment