Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][inne]Objaśnienie pliku - Varnish
Axel88
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 5.08.2015

Ostrzeżenie: (0%)
-----


Witam.
Jestem całkowicie zielony jeśli chodzi o varnisha dlatego mam pytanie odnośnie konfiguracji.

Zainstalowano mi na serwerze varnish jednak nie przyśpieszyło to zbyt wiele wczytywania strony, może jest coś nie tak z konfiguracją?
Może czegoś brakuje ?
Proszę o wyrozumiałość i z góry dziękuję za pomoc.

  1. # This is a basic VCL configuration file for varnish. See the vcl(7)
  2. # man page for details on VCL syntax and semantics.
  3. #
  4. # Default backend definition. Set this to point to your content
  5. # server.
  6. #
  7. backend default {
  8. .host = "xxx.xx.xx.xx";
  9. .port = "83";
  10. }
  11. #
  12. # Below is a commented-out copy of the default VCL logic. If you
  13. # redefine any of these subroutines, the built-in logic will be
  14. # appended to your code.
  15. # sub vcl_recv {
  16. # if (req.restarts == 0) {
  17. # if (req.http.x-forwarded-for) {
  18. # set req.http.X-Forwarded-For =
  19. # req.http.X-Forwarded-For + ", " + client.ip;
  20. # } else {
  21. # set req.http.X-Forwarded-For = client.ip;
  22. # }
  23. # }
  24. # if (req.request != "GET" &&
  25. # req.request != "HEAD" &&
  26. # req.request != "PUT" &&
  27. # req.request != "POST" &&
  28. # req.request != "TRACE" &&
  29. # req.request != "OPTIONS" &&
  30. # req.request != "DELETE") {
  31. # /* Non-RFC2616 or CONNECT which is weird. */
  32. # return (pipe);
  33. # }
  34. # if (req.request != "GET" && req.request != "HEAD") {
  35. # /* We only deal with GET and HEAD by default */
  36. # return (pass);
  37. # }
  38. # if (req.http.Authorization || req.http.Cookie) {
  39. # /* Not cacheable by default */
  40. # return (pass);
  41. # }
  42. # return (lookup);
  43. # }
  44. #
  45. # sub vcl_pipe {
  46. # # Note that only the first request to the backend will have
  47. # # X-Forwarded-For set. If you use X-Forwarded-For and want to
  48. # # have it set for all requests, make sure to have:
  49. # # set bereq.http.connection = "close";
  50. # # here. It is not set by default as it might break some broken web
  51. # # applications, like IIS with NTLM authentication.
  52. # return (pipe);
  53. # }
  54. #
  55. # sub vcl_pass {
  56. # return (pass);
  57. # }
  58. #
  59. # sub vcl_hash {
  60. # hash_data(req.url);
  61. # if (req.http.host) {
  62. # hash_data(req.http.host);
  63. # } else {
  64. # hash_data(server.ip);
  65. # }
  66. # return (hash);
  67. # }
  68. #
  69. # sub vcl_hit {
  70. # return (deliver);
  71. # }
  72. #
  73. # sub vcl_miss {
  74. # return (fetch);
  75. # }
  76. #
  77. # sub vcl_fetch {
  78. # if (beresp.ttl <= 0s ||
  79. # beresp.http.Set-Cookie ||
  80. # beresp.http.Vary == "*") {
  81. # /*
  82. # * Mark as "Hit-For-Pass" for the next 2 minutes
  83. # */
  84. # set beresp.ttl = 600 s;
  85. # return (hit_for_pass);
  86. # }
  87. # return (deliver);
  88. # }
  89. #
  90. # sub vcl_deliver {
  91. # return (deliver);
  92. # }
  93. #
  94. # sub vcl_error {
  95. # set obj.http.Content-Type = "text/html; charset=utf-8";
  96. # set obj.http.Retry-After = "5";
  97. # synthetic {"
  98. # <?xml version="1.0" encoding="utf-8"?>
  99. # <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  100. # "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  101. # <html>
  102. # <head>
  103. # <title>"} + obj.status + " " + obj.response + {"</title>
  104. # </head>
  105. # <body>
  106. # <h1>Error "} + obj.status + " " + obj.response + {"</h1>
  107. # <p>"} + obj.response + {"</p>
  108. # <h3>Guru Meditation:</h3>
  109. # <p>XID: "} + req.xid + {"</p>
  110. # <hr>
  111. # <p>Varnish cache server</p>
  112. # </body>
  113. # </html>
  114. # "};
  115. # return (deliver);
  116. # }
  117. #
  118. # sub vcl_init {
  119. # return (ok);
  120. # }
  121. #
  122. # sub vcl_fini {
  123. # return (ok);
  124. # }
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.12.2025 - 20:13