Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save technoknol/f444bfe01512ac7589f66efbd16750fe to your computer and use it in GitHub Desktop.
Save technoknol/f444bfe01512ac7589f66efbd16750fe to your computer and use it in GitHub Desktop.
Nginx configuration server block (Virtual host) for Laravel Setup.
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