Advertisement
sweemeng

nginx wordpres config

Jan 27th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. upstream php {
  2. server unix:/tmp/php-cgi.socket;
  3. server 127.0.0.1:53217;
  4. }
  5.  
  6. server {
  7. ## Your website name goes here.
  8. server_name nomadiccodemonkey.com;
  9. ## Your only path reference.
  10. root /opt/blog;
  11. ## This should be in your http block and if it is, it's not needed here.
  12. index index.php;
  13.  
  14. location = /favicon.ico {
  15. log_not_found off;
  16. access_log off;
  17. }
  18.  
  19. location = /robots.txt {
  20. allow all;
  21. log_not_found off;
  22. access_log off;
  23. }
  24.  
  25. location /blog {
  26. # This is cool because no php is touched for static content
  27. try_files $uri $uri/ /index.php;
  28. if (!-e $request_filename) {
  29. rewrite ^(.*)$ /index.php?q=$1 last;
  30. break;
  31. }
  32. }
  33.  
  34.  
  35. location ~ \.php$ {
  36. #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  37. include fastcgi.conf;
  38. fastcgi_intercept_errors on;
  39. fastcgi_pass php;
  40. }
  41.  
  42. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  43. expires max;
  44. log_not_found off;
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement