Skip to content

Instantly share code, notes, and snippets.

@orther
Created February 12, 2012 04:47
Show Gist options
  • Select an option

  • Save orther/1806414 to your computer and use it in GitHub Desktop.

Select an option

Save orther/1806414 to your computer and use it in GitHub Desktop.
server {
   listen      8118;
   server_name website.com www.website.com;
   root        /var/www/website/www;
   expires 1M;
   # route requests to front controller
   location / {
       rewrite ^(.+)$ /index.php?__rlquery=$uri last;
   }
   # static content
   location ~ ^/(_css|_images|_js|_files|_swf) {
       access_log  off;
       expires     max;
   }
   # front controller routed to php-fpm
   location ~ ^/index\.php$ {
       expires off;
       include /etc/nginx/fastcgi_params;
       fastcgi_pass  127.0.0.1:9000;
       fastcgi_index index.php;
       fastcgi_param QUERY_STRING     $query_string;
       fastcgi_param SCRIPT_FILENAME  /var/www/website/www/index.php;
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment