Last active
December 12, 2017 07:23
-
-
Save technoknol/f444bfe01512ac7589f66efbd16750fe to your computer and use it in GitHub Desktop.
Nginx configuration server block (Virtual host) for Laravel Setup.
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
server { | |
listen 80 ; | |
listen [::]:80; | |
root /var/www/html/blog2/public/; | |
index index.php index.htm index.nginx-debian.html; | |
server_name blog2.com; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
location ~ \.php$ { | |
# include snippets/fastcgi-php.conf; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
# fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
# | |
# # With php-fpm (or other unix sockets): | |
fastcgi_pass unix:/var/run/php/php7.1-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