Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
server {
listen 443 ssl;
ssl_certificate /etc/ssl/;
ssl_certificate_key /etc/ssl/;
access_log /var/log/nginx/;
root /home/;
index index.php;
client_max_body_size 5m;
client_body_timeout 60;
location / {
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*).html$ /index.php?name=$1&$args;
location ~ \.php$ {
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
location ^~ /cache/ {
deny all;
location ^~ /.git {
deny all;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment