Created
June 10, 2019 06:05
-
-
Save nahidacm/70013e41cb605f3e4e4c7f69974ca2b7 to your computer and use it in GitHub Desktop.
Ngix block file for laravel virtual host
This file contains hidden or 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
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/test.loc; | |
# Add index.php to the list if you are using PHP | |
index index.php index.html index.htm index.nginx-debian.html; | |
server_name test.loc; | |
location / { | |
# First attempt to serve request as file, then | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
# pass PHP scripts to FastCGI server | |
# | |
location ~ \.php$ { | |
include snippets/fastcgi-php.conf; | |
# | |
# # With php-fpm (or other unix sockets): | |
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; | |
# # With php-cgi (or other tcp sockets): | |
# fastcgi_pass 127.0.0.1:9000; | |
} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
location ~ /\.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment