Advertisement
Guest User

Untitled

a guest
Nov 15th, 2012
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. server {
  2. # Replace this port with the right one for your requirements
  3. listen 80;
  4.  
  5. # Multiple hostnames separated by spaces. Replace these as well.
  6. server_name nope nope;
  7.  
  8. root /home/web/nope;
  9. access_log /home/web/logs/nope;
  10. # We'll enable errorlog for a bit, to see if anything breaks
  11. error_log /home/web/logs/nope;
  12.  
  13. index index.php index.html index.htm;
  14.  
  15. # static file 404's aren't logged and expires header is set to maximum age
  16. location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
  17. access_log off;
  18. expires max;
  19. }
  20.  
  21. # Need the $uri and $args for donating to work.
  22. location / {
  23. try_files $uri $uri/ /index.php?q=$uri&$args;
  24. }
  25.  
  26. location /~ { return 404; }
  27. location ~* wp-config.php { deny all; }
  28. location ~* wp-admin/includes { deny all; }
  29. location ~* wp-includes/theme-compat/ { deny all; }
  30. location ~* wp-includes/js/tinymce/langs/.*\.php { deny all; }
  31. location /wp-content/ { internal; }
  32. location /wp-includes/ { internal; }
  33. location ~* ^/wp-content/uploads/.*.(html|htm|shtml|php)$ {
  34. types { }
  35. default_type text/plain;
  36. }
  37.  
  38. location ~ \.php$ {
  39. set $memcached_key "wordpress:$request_uri";
  40. memcached_pass 127.0.0.1:11211;
  41. default_type text/html;
  42. error_page 404 405 502 = @cache_miss;
  43. }
  44.  
  45. location @cache_miss {
  46. include fastcgi_params;
  47. try_files $uri =404;
  48. fastcgi_intercept_errors on;
  49. # By all means use a different server for the fcgi processes if you need to
  50. fastcgi_pass unix:/tmp/php-fpm.sock;
  51. }
  52.  
  53. location ~ /\. {
  54. deny all;
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement