Advertisement
Guest User

Untitled

a guest
May 4th, 2012
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user www-data www-data;
  2. worker_processes  1;
  3.  
  4. events {
  5.     worker_connections  1024;
  6.        }
  7.  
  8.  
  9. http {
  10.     include       mime.types;
  11.     default_type  application/octet-stream;
  12.  
  13.     sendfile        on;
  14.     keepalive_timeout  65;
  15.  
  16.     server {
  17.         listen       80;
  18.         server_name  sitename.com www.sitename.com;
  19.         location /blog/ {
  20.             root /www/sitename/new/htdocs/blog;
  21.             index index.php;
  22.             internal;
  23.  
  24.             if (!-e $request_filename) {
  25.             rewrite ^.+?(/.*\.php)$ /blog$1 last;
  26.             rewrite ^.+?(/wp-.*) /blog$1 last;
  27.             rewrite ^ /blog/index.php last;
  28.             }
  29.            
  30.  
  31.         location / {
  32.               root   /www/sitename/new/htdocs;
  33.               index  index.php;
  34.               if (-f $request_filename) {
  35.                     break;
  36.               }
  37.               if (!-f $request_filename) {
  38.                     rewrite ^/(.*)$ /index.php?$1 last;
  39.                     break;
  40.               }
  41.               error_log   /www/sitename/new/error.log warn;
  42.             }
  43.             location ~ \.php$ {
  44.                 set $php_root           /www/sitename/new/htdocs;
  45.                 if ($request_uri ~ /blog) {
  46.                    set $php_root /www/sitename/new/htdocs/blog;
  47.                 }
  48.                 fastcgi_split_path_info ^(/blog)(/.*)$;
  49.                 fastcgi_pass   127.0.0.1:9000;
  50.                 fastcgi_index  index.php;
  51.                 fastcgi_param  SCRIPT_FILENAME  $php_root$fastcgi_script_name;
  52.                 include        fastcgi_params;
  53.             }
  54.             #deny access to apache .htaccess files
  55.             location ~ /\.ht
  56.             {
  57.                 deny all;
  58.             }
  59.       }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement