Skip to content

Instantly share code, notes, and snippets.

@dhayab
Created July 10, 2013 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhayab/5967162 to your computer and use it in GitHub Desktop.
Save dhayab/5967162 to your computer and use it in GitHub Desktop.
# Rewrite for content.
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location ~* \.php$ {
# Server PHP config.
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
# Typical vars in here, nothing interesting.
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
# Hells no, we usin nginx up in this mutha. (deny .htaccess)
deny all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment