Last active
August 29, 2015 14:11
-
-
Save sn/6bac786fd175f471b64e to your computer and use it in GitHub Desktop.
Kirby Nginx configuration file for site running on PHP FastCGI
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; | |
listen [::]:80; | |
root /var/www/site; | |
index index.php index.html index.htm; | |
server_name _; | |
autoindex on; | |
access_log off; | |
# Kirby Specific Directories | |
rewrite ^/site/(.*) /error permanent; | |
rewrite ^/kirby/(.*) /error permanent; | |
location ~ .php { | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_script_name; | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 256 16k; | |
fastcgi_busy_buffers_size 256k; | |
fastcgi_temp_file_write_size 256k; | |
include fastcgi_params; | |
} | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location ~* .(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ { | |
try_files $uri =404; | |
expires max; | |
access_log off; | |
add_header Pragma public; | |
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment