Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- location / {
- root /var/www/html;
- if ($host = 'xxx.com' ) {
- rewrite ^/(.*)$ $scheme://www.xxx.com/$1 permanent;
- }
- #adding boost
- set $boost "";
- set $boost_query "_";
- if ( $request_method = GET ) {
- set $boost G;
- }
- if ($http_cookie !~ "DRUPAL_UID") {
- set $boost "${boost}D";
- }
- if ($query_string = "") {
- set $boost "${boost}Q";
- }
- if ( -f /var/www/html/cache/normal/$host$request_uri$boost_query.html.gz ) {
- set $boost "${boost}F";
- }
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- if ($boost = GDQF){
- rewrite ^.*$ /cache/normal/$host/$request_uri$boost_query.html.gz break;
- }
- if ($boost !~ GDQF) {
- proxy_pass http://localhost:8080;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement