NoPaste.me

Secure and Anonymous

Login

  • Only for Administration!
Time 04.01.2013 - 16:42
This paste is public Public
Show Options
  1. # WordPress single blog rules.
  2. # Designed to be included in any server {} block.
  3.  
  4. # This order might seem weird - this is attempted to match last if rules below fail.
  5. # http://wiki.nginx.org/HttpCoreModule
  6. location / {
  7.         try_files $uri $uri/ /wp34en/index.php?$args;
  8.         #try_files $uri $uri/ /index.php?q=$uri&$args;
  9. }
  10.  
  11. # Add trailing slash to */wp-admin requests.
  12. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
  13.  
  14.  
  15. # Directives to send expires headers and turn off 404 error logging.
  16. location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
  17.         expires 24h;
  18.         log_not_found off;
  19. }
  20.  
  21.  
  22. # Uncomment one of the lines below for the appropriate caching plugin (if used).
  23. #include global/wordpress-wp-super-cache.conf;
  24. #include global/wordpress-w3-total-cache.conf;
  25.  
  26. # Pass all .php files onto a php-fpm/php-fcgi server.
  27. location ~ \.php$ {
  28.         # Zero-day exploit defense.
  29.         # http://forum.nginx.org/read.php?2,88845,page=3
  30.         # Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
  31.         # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine.  And then cross your fingers that you won't get hacked.
  32.         try_files $uri = 404;
  33.  
  34.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  35.         #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  36.        
  37.        
  38.         include fastcgi_params;
  39.         fastcgi_index index.php;
  40.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  41.         #fastcgi_param  QUERY_STRING     $query_string;
  42.         #fastcgi_param  REQUEST_METHOD   $request_method;
  43.         #fastcgi_param  CONTENT_TYPE     $content_type;
  44.         #fastcgi_param  CONTENT_LENGTH   $content_length;      
  45.         #fastcgi_intercept_errors on;
  46.         fastcgi_pass php;
  47.        
  48. }