Advertisement
RandallKent

Untitled

Aug 8th, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2. location / {
  3. root /var/www/html;
  4.  
  5. if ($host = 'xxx.com' ) {
  6. rewrite ^/(.*)$ $scheme://www.xxx.com/$1 permanent;
  7. }
  8.  
  9. #adding boost
  10. set $boost "";
  11. set $boost_query "_";
  12.  
  13. if ( $request_method = GET ) {
  14. set $boost G;
  15. }
  16.  
  17. if ($http_cookie !~ "DRUPAL_UID") {
  18. set $boost "${boost}D";
  19. }
  20.  
  21. if ($query_string = "") {
  22. set $boost "${boost}Q";
  23. }
  24.  
  25. if ( -f /var/www/html/cache/normal/$host$request_uri$boost_query.html.gz ) {
  26. set $boost "${boost}F";
  27. }
  28.  
  29. proxy_set_header X-Real-IP $remote_addr;
  30. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  31. proxy_set_header Host $host;
  32.  
  33. if ($boost = GDQF){
  34. rewrite ^.*$ /cache/normal/$host/$request_uri$boost_query.html.gz break;
  35. }
  36.  
  37. if ($boost !~ GDQF) {
  38. proxy_pass http://localhost:8080;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement