Skip to content

Instantly share code, notes, and snippets.

@takeokunn
Created September 10, 2019 04:41
Show Gist options
  • Save takeokunn/fe6b4748d06905a693e8f18d92b6c40a to your computer and use it in GitHub Desktop.
Save takeokunn/fe6b4748d06905a693e8f18d92b6c40a to your computer and use it in GitHub Desktop.
server {
listen [::]:80;
listen 80;
index index.php index.html;
root /var/www/october;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log warn;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi.conf;
include fastcgi_params;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 120s;
}
location = favicon.ico {
access_log off;
log_not_found off;
expires 8d;
}
location = robots.txt {
access_log off;
log_not_found off;
}
location ~ .*\.(html?|jpe?g|gif|png|swf|inc|woff|svg|ttf) {
expires 8d;
access_log off;
log_not_found off;
}
location ~ .*\.(js|css) {
expires 8d;
access_log off;
log_not_found off;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
rewrite ^themes/.*/(layouts|pages|partials)/.*.htm /index.php break;
rewrite ^bootstrap/.* /index.php break;
rewrite ^config/.* /index.php break;
rewrite ^vendor/.* /index.php break;
rewrite ^storage/cms/.* /index.php break;
rewrite ^storage/logs/.* /index.php break;
rewrite ^storage/framework/.* /index.php break;
rewrite ^storage/temp/protected/.* /index.php break;
rewrite ^storage/app/uploads/protected/.* /index.php break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment