Highdude

default.conf

Nov 5th, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. server {
  2. listen 80;
  3.  
  4. server_name leavingthepast.net www.leavingthepast.net;
  5.  
  6. root /usr/share/nginx/html;
  7.  
  8. access_log /var/log/nginx/ltp.access.log;
  9. error_log /var/log/nginx/ltp.error.log;
  10.  
  11. location / {
  12. # This line when enabled will use Nginx's gzip static module
  13. gzip_static on;
  14.  
  15. # Disables serving gzip content to IE 6 or below
  16. gzip_disable "MSIE [1-6]\.";
  17.  
  18. # Sets the default type to text/html so that gzipped content is served
  19. # as html, instead of raw uninterpreted data.
  20. default_type text/html;
  21.  
  22. # does the requested file exist exactly as it is? if yes, serve it and stop here
  23. if (-f $request_filename) { break; }
  24.  
  25. # sets some variables to help test for the existence of a cached copy of the request
  26. set $supercache_file '';
  27. set $supercache_uri $request_uri;
  28.  
  29. # IF the request is a post, has a query attached, or a cookie
  30. # then don't serve the cache (ie: users logged in, or posting comments)
  31. if ($request_method = POST) { set $supercache_uri ''; }
  32. if ($query_string) { set $supercache_uri ''; }
  33. if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) {
  34. set $supercache_uri '';
  35. }
  36.  
  37. # if the supercache_uri variable hasn't been blanked by this point, attempt
  38. # to set the name of the destination to the possible cache file
  39. if ($supercache_uri ~ ^(.+)$) {
  40. set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
  41. }
  42.  
  43. # If a cache file of that name exists, serve it directly
  44. if (-f $document_root$supercache_file) { rewrite ^ $supercache_file break; }
  45.  
  46. # Otherwise send the request back to index.php for further processing
  47. if (!-e $request_filename) { rewrite ^ /index.php last; }
  48. }
  49.  
  50. fastcgi_intercept_errors off;
  51.  
  52. location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
  53. expires max;
  54. add_header Pragma public;
  55. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  56. }
  57.  
  58. include php.conf;
  59.  
  60. # You may want to remove the robots line from drop to use a virtual robots.txt
  61. # or create a drop_wp.conf tailored to the needs of the wordpress configuration
  62. include drop.conf;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment