Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name domain.com;
- charset utf-8;
- root /var/www/project/public;
- location / {
- index index.php;
- }
- # removes trailing slashes (prevents SEO duplicate content issues)
- if (!-d $request_filename)
- {
- rewrite ^/(.+)/$ /$1 permanent;
- }
- # removes trailing "index" from all controllers
- if ($request_uri ~* index/?$)
- {
- rewrite ^/(.*)/index/?$ /$1 permanent;
- }
- # unless the request is for a valid file (image, js, css, etc.), send to bootstrap
- if (!-e $request_filename)
- {
- rewrite ^/(.*)$ /index.php?/$1 last;
- break;
- }
- location ~* ^.+\.php$ {
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param DOCUMENT_ROOT $document_root;
- include fastcgi_params;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement