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 sidis405/688185b24823bba134aaa395a99c721e to your computer and use it in GitHub Desktop.
Save sidis405/688185b24823bba134aaa395a99c721e to your computer and use it in GitHub Desktop.
Nginx conf for valet like behaviour
server {
listen 80;
server_name HOST_NAME;
root "/var/www/HOST_NAME/current/public";
index index.php index.html index.htm;
access_log off;
error_log /var/log/nginx/HOST_NAME.error.log crit;
# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location / {
try_files $uri $uri/ /storage/$uri /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment