Created
August 16, 2017 14:46
-
-
Save spyric/4eea90db8525341afc2300c272920333 to your computer and use it in GitHub Desktop.
Nginx conf for valet like behaviour
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; | |
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