Advertisement
Guest User

Nginx WP/CI Confusion

a guest
Aug 25th, 2011
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.     listen 80;
  3.     server_name dimasrocks.com;
  4.     root /var/www/dimasrocks.com/public_html;
  5.     index index.php index.html index.htm;
  6.     #access_log logs/host.access.log;
  7.  
  8. location  / {
  9.         # this serves static files that exist without running other rewrite tests
  10.         if (-f \$request_filename) {
  11.             expires 30d;
  12.             break;
  13.         }
  14.         # this sends all non-existing file or directory requests to index.php
  15.         if (!-e $request_filename) {
  16.             rewrite ^/css/(.)$ /wp-content/themes/roots/css/$1 last;
  17.             rewrite ^/js/(.)$ /wp-content/themes/roots/js/$1 last;
  18.             rewrite ^/img/(.)$ /wp-content/themes/roots/img/$1 last;
  19.             rewrite ^/plugins/(.)$ /wp-content/plugins/$1 last;
  20.             rewrite ^(.+)$ /index.php last;
  21.         }
  22.     }
  23.  
  24.     location = /favicon.ico {
  25.         log_not_found off;
  26.         access_log off;
  27.     }
  28.     location = /robots.txt {
  29.         allow all;
  30.         log_not_found off;
  31.         access_log off;
  32.     }
  33.     location ~ \.php$ {
  34.         root public_html;
  35.         fastcgi_pass 127.0.0.1:9000;
  36.         fastcgi_param SCRIPT_FILENAME /var/www/dimasrocks.com/public_html/$fastcgi_script_name;
  37.         include fastcgi_params;
  38.     }
  39.     location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  40.         expires max;
  41.         log_not_found off;
  42.         root /var/www/dimasrocks.com/public_html/;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement