Skip to content

Instantly share code, notes, and snippets.

@srmklive
Created May 14, 2018 12:08
Show Gist options
  • Save srmklive/efc28ca9ba7f78fe7e1a29aa678c3226 to your computer and use it in GitHub Desktop.
Save srmklive/efc28ca9ba7f78fe7e1a29aa678c3226 to your computer and use it in GitHub Desktop.
Nginx VirtualHost: Laravel
# Uncomment the following code to force https mode.
#server {
# listen 80;
# server_name laravel.test;
# return 301 https://laravel.test$request_uri;
#}
server {
listen 80; # comment this line & uncomment the line below to force https mode.
#listen 443 ssl http2;
server_name laravel.test;
root /home/raza/Code/laravel-app/public;
index index.html index.htm index.php;
include /etc/nginx/conf.d/self-signed.conf;
include /etc/nginx/conf.d/ssl-params.conf;
charset utf-8;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/laravel-test-error.log error;
sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment