Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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
You can’t perform that action at this time.