/etc/varnish/default.vcl

1 개요[ | ]

/etc/varnish/default.vcl
default.vcl
  • varnish를 위한 기본 VCL 설정 파일
  • 공백, 주석 제외

2 6.3 기본값[ | ]

vcl 4.1;

# Default backend definition. Set this to point to your content server.
backend default {
    .host = "127.0.0.1";
    .port = "8080";
}

sub vcl_recv {
    # Happens before we check if we have this in cache already.
    #
    # Typically you clean up the request here, removing cookies you don't need,
    # rewriting the request, etc.
}

sub vcl_backend_response {
    # Happens after we have read the response headers from the backend.
    #
    # Here you clean the response headers, removing silly Set-Cookie headers
    # and other mistakes your backend does.
}

sub vcl_deliver {
    # Happens when we have all the pieces we need, and are about to send the
    # response to the client.
    #
    # You can do accounting or modifying the final object here.
}

3 4.0 기본값[ | ]

vcl 4.0;
backend default {
    .host = "127.0.0.1";
    .port = "8080";
}
sub vcl_recv {
}
sub vcl_backend_response {
}
sub vcl_deliver {
}

4 3.0 기본값[ | ]

backend default {
  .host = "127.0.0.1";
  .port = "8080";
}

5 도메인 넘겨주기[ | ]

backend default {
  .host = "127.0.0.1";
  .port = "8080";
}

sub vcl_recv {
    if (req.http.host ~ "^(.+\.)?jmnote\.com$") {
	set req.http.x-redir-url = "http://zetawiki.com" + req.url;
        error 750 req.http.x-redir-url;
    }
}

sub vcl_error {
    if (obj.status == 750) {
        set obj.http.Location = obj.response;
        set obj.status = 302;
        return (deliver);
    }
}

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}