Guest User

Untitled

a guest
Feb 9th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.78 KB | None | 0 0
  1. .htaccess
  2.  
  3. `
  4. # BEGIN WordPress
  5. <IfModule mod_rewrite.c>
  6. RewriteEngine On
  7. RewriteBase /
  8. RewriteRule ^index\.php$ - [L]
  9. RewriteCond %{REQUEST_FILENAME} !-f
  10. RewriteCond %{REQUEST_FILENAME} !-d
  11. RewriteRule . /index.php [L]
  12. </IfModule>
  13.  
  14. # END WordPress
  15. Header unset Pragma
  16. FileETag None
  17. Header unset ETag
  18.  
  19.  
  20.  
  21. ## HIDE THE FACT THE SITE IS POWERED BY PHP ##
  22. <IfModule mod_headers.c>
  23. Header unset X-Powered-By
  24. Header unset Server
  25. </IfModule>
  26.  
  27. # BEGIN Expire headers ##
  28. <ifModule mod_expires.c>
  29. ExpiresActive On
  30. ExpiresDefault "access plus 5 seconds"
  31. ExpiresByType image/x-icon "access plus 604800 seconds"
  32. ExpiresByType image/jpeg "access plus 604800 seconds"
  33. ExpiresByType image/png "access plus 604800 seconds"
  34. ExpiresByType image/gif "access plus 604800 seconds"
  35. ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
  36. ExpiresByType text/css "access plus 604800 seconds"
  37. ExpiresByType text/javascript "access plus 604800 seconds"
  38. ExpiresByType application/javascript "access plus 604800 seconds"
  39. ExpiresByType application/x-javascript "access plus 604800 seconds"
  40. #ExpiresByType text/html "access plus 600 seconds"
  41. #ExpiresByType application/xhtml+xml "access plus 600 seconds"
  42. </ifModule>
  43.  
  44. ## ENABLE GZIP COMPRESSION ##
  45. <IfModule mod_deflate.c>
  46. <FilesMatch "\\.(js|css|html|htm|php|xml)$">
  47. SetOutputFilter DEFLATE
  48. </FilesMatch>
  49. </IfModule>
  50.  
  51.  
  52. <IfModule mod_gzip.c>
  53. mod_gzip_on Yes
  54. mod_gzip_dechunk Yes
  55. mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  56. mod_gzip_item_include handler ^cgi-script$
  57. mod_gzip_item_include mime ^text/.*
  58. mod_gzip_item_include mime ^application/x-javascript.*
  59. mod_gzip_item_exclude mime ^image/.*
  60. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  61. </IfModule>
  62.  
  63.  
  64.  
  65. ## PAGESPEED MODULE ##
  66. <IfModule pagespeed_module>
  67. ModPagespeed on
  68. ModPagespeedEnableFilters
  69. extend_cache,combine_css,combine_javascript,collapse_whitespace,move_css_to_head
  70. </IfModule>
  71.  
  72.  
  73.  
  74. # BEGIN Cache-Control Headers
  75. <IfModule mod_headers.c>
  76.  
  77. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  78. Header set Cache-Control "public"
  79. </filesMatch>
  80.  
  81. <filesMatch "\.(css)$">
  82. Header set Cache-Control "public"
  83. </filesMatch>
  84.  
  85. <filesMatch "\.(js)$">
  86. Header set Cache-Control "private"
  87. </filesMatch>
  88.  
  89. <filesMatch "\.(x?html?|php)$">
  90. Header set Cache-Control "private, must-revalidate"
  91. </filesMatch>
  92.  
  93. </IfModule>
  94.  
  95.  
  96. # VARY Accept-Encoding Headers
  97. <IfModule mod_headers.c>
  98. <FilesMatch ".(js|css|xml|gz|html)$">
  99. Header append Vary: Accept-Encoding
  100. </FilesMatch>
  101. </IfModule>
  102.  
  103.  
  104.  
  105.  
  106. <FilesMatch "^.*(error_log|wp-config\.php|php.ini|\.[hH][tT][aApP].*)$">
  107. Order deny,allow
  108. Deny from all
  109. </FilesMatch>
  110.  
  111.  
  112. <IfModule mod_rewrite.c>
  113. RewriteEngine on
  114. RewriteCond %{HTTP_REFERER} !^$
  115. RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com [NC]
  116. RewriteRule \.(jpg|jpeg|png|gif)$ http://domain.com/wp-content/uploads/2015/03/hotlinking.png [NC,R,L]
  117. </IfModule>
  118.  
  119. `
  120.  
  121.  
  122. nginx.conf
  123.  
  124. `
  125.  
  126. user www-data;
  127. worker_processes 1;
  128. pid /run/nginx.pid;
  129.  
  130. events {
  131. worker_connections 1024;
  132. # multi_accept on;
  133. }
  134.  
  135. http {
  136.  
  137. ##
  138. # Basic Settings
  139. ##
  140.  
  141. sendfile on;
  142. tcp_nopush on;
  143. tcp_nodelay on;
  144. keepalive_timeout 65;
  145. types_hash_max_size 2048;
  146. server_tokens off;
  147. client_max_body_size 15m;
  148. client_body_timeout 60;
  149. client_header_timeout 60;
  150. client_body_buffer_size 1K;
  151. client_header_buffer_size 1k;
  152. large_client_header_buffers 4 8k;
  153. send_timeout 60;
  154. reset_timedout_connection on;
  155.  
  156. # server_names_hash_bucket_size 64;
  157. # server_name_in_redirect off;
  158.  
  159. include /etc/nginx/mime.types;
  160. default_type application/octet-stream;
  161.  
  162. ##
  163. # SSL Settings
  164. ##
  165.  
  166. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  167. ssl_prefer_server_ciphers on;
  168.  
  169. ##
  170. # Logging Settings
  171. ##
  172.  
  173. access_log /var/log/nginx/access.log;
  174. error_log /var/log/nginx/error.log;
  175.  
  176. ##
  177. # Gzip Settings
  178. ##
  179.  
  180. gzip on;
  181. gzip_disable "msie6";
  182. gzip_vary on;
  183. gzip_proxied any;
  184. gzip_comp_level 6;
  185. gzip_buffers 16 8k;
  186. gzip_http_version 1.1;
  187. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript text/x-component application/x-javascript font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
  188.  
  189. ##
  190. # Virtual Host Configs
  191. ##
  192.  
  193. include /etc/nginx/conf.d/*.conf;
  194. include /etc/nginx/sites-enabled/*;
  195. }
  196.  
  197.  
  198. #mail {
  199. # # See sample authentication script at:
  200. # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  201. #
  202. # # auth_http localhost/auth.php;
  203. # # pop3_capabilities "TOP" "USER";
  204. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  205. #
  206. # server {
  207. # listen localhost:110;
  208. # protocol pop3;
  209. # proxy on;
  210. # }
  211. #
  212. # server {
  213. # listen localhost:143;
  214. # protocol imap;
  215. # proxy on;
  216. # }
  217. #}
  218.  
  219. `
  220.  
  221. nginx/sites-enabled/site
  222.  
  223. `
  224.  
  225. # You may add here your
  226. # server {
  227. # ...
  228. # }
  229. # statements for each of your virtual hosts to this file
  230.  
  231. ##
  232. # You should look at the following URL's in order to grasp a solid understanding
  233. # of Nginx configuration files in order to fully unleash the power of Nginx.
  234. # http://wiki.nginx.org/Pitfalls
  235. # http://wiki.nginx.org/QuickStart
  236. # http://wiki.nginx.org/Configuration
  237. #
  238. # Generally, you will want to move this file somewhere, and start with a clean
  239. # file but keep this around for reference. Or just disable in sites-enabled.
  240. #
  241. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  242. #
  243.  
  244.  
  245. server {
  246. listen 127.0.0.1:8080; ## listen for ipv4; this line is default and implied
  247. #listen [::]:80 default ipv6only=on; ## listen for ipv6
  248.  
  249. root /var/www;
  250. index index.php index.html index.htm;
  251.  
  252. # Make site accessible from http://localhost/
  253. server_name domain.com;
  254. client_body_buffer_size 10K;
  255. client_header_buffer_size 1k;
  256. client_max_body_size 80m;
  257. large_client_header_buffers 2 1k;
  258. client_body_timeout 12;
  259. client_header_timeout 12;
  260. keepalive_timeout 15;
  261. send_timeout 10;
  262.  
  263. #Fix Yoast SEO Sitemaps
  264. rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
  265. rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
  266.  
  267.  
  268. # Use gzip compression
  269. gzip_static on; # Uncomment if you compiled Nginx using --with-http_gzip_static_module
  270. gzip on;
  271. gzip_disable "msie6";
  272. gzip_vary on;
  273. gzip_proxied any;
  274. gzip_comp_level 6;
  275. gzip_buffers 16 8k;
  276. gzip_http_version 1.1;
  277. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript image/png image/gif image/jpeg text/x-component application/javascript font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
  278.  
  279.  
  280. # Cache static files for as long as possible - removed xml as an extension to avoid problems with Yoast WordPress SEO plugin which uses WP rewrite API.
  281. location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)$ {
  282. try_files $uri =404;
  283. expires max;
  284. access_log off;
  285. log_not_found off;
  286. add_header Pragma public;
  287. }
  288.  
  289. # Deny access to hidden files
  290. location ~* /\.ht {
  291. deny all;
  292. access_log off;
  293. log_not_found off;
  294. }
  295.  
  296.  
  297. # Rewrite minified CSS and JS files
  298. #rewrite ^/wp-content/w3tc/min/([a-f0-9]+)\/(.+)\.(include(\-(footer|body))?(-nb)?)\.[0-9]+\.(css|js)$ /wp-content/w3tc/min/index.php?tt=$1&gg=$2&g=$3&t=$7 last;
  299.  
  300.  
  301. # Set a variable to work around the lack of nested conditionals
  302. set $cache_uri $request_uri;
  303.  
  304.  
  305. # POST requests and urls with a query string should always go to PHP
  306. if ($request_method = POST) {
  307. set $cache_uri 'no cache';
  308. }
  309. if ($query_string != "") {
  310. set $cache_uri 'no cache';
  311. }
  312.  
  313.  
  314. # Don't cache uris containing the following segments
  315. if ($request_uri ~* "(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php|wp\-comments\-popup\.php|wp\-links\-opml\.php|wp\-locations\.php)") {
  316. set $cache_uri "no cache";
  317. }
  318.  
  319.  
  320. # Don't use the cache for logged in users or recent commenters
  321. if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp\-postpass|wordpress_logged_in") {
  322. set $cache_uri 'no cache';
  323. }
  324.  
  325.  
  326.  
  327. location / {
  328. # First attempt to serve request as file, then
  329. # as directory, then fall back to index.html
  330. try_files /wp-content/cache/wp-rocket/$http_host/$cache_uri/index.html $uri/ /index.php?q=$uri&$args;
  331. # Uncomment to enable naxsi on this location
  332. # include /etc/nginx/naxsi.rules
  333. }
  334.  
  335. location /doc/ {
  336. alias /usr/share/doc/;
  337. autoindex on;
  338. allow 127.0.0.1;
  339. deny all;
  340. }
  341.  
  342. # Only for nginx-naxsi : process denied requests
  343. #location /RequestDenied {
  344. # For example, return an error code
  345. #return 418;
  346. #}
  347.  
  348. error_page 404 /404.html;
  349.  
  350. # redirect server error pages to the static page /50x.html
  351. #
  352. error_page 500 502 503 504 /50x.html;
  353. location = /50x.html {
  354. root /usr/share/nginx/www;
  355. }
  356.  
  357. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  358. #
  359. location ~ \.php$ {
  360. try_files $uri =404;
  361. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  362. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  363. fastcgi_pass unix:/var/run/php5-fpm.sock;
  364. fastcgi_index index.php;
  365. include fastcgi_params;
  366. fastcgi_param QUERY_STRING $query_string;
  367. fastcgi_param REQUEST_METHOD $request_method;
  368. fastcgi_param CONTENT_TYPE $content_type;
  369. fastcgi_param CONTENT_LENGTH $content_length;
  370. fastcgi_intercept_errors off;
  371. fastcgi_ignore_client_abort off;
  372. fastcgi_connect_timeout 60;
  373. fastcgi_send_timeout 180;
  374. fastcgi_read_timeout 600;
  375. fastcgi_buffer_size 128k;
  376. fastcgi_buffers 4 256k;
  377. fastcgi_busy_buffers_size 256k;
  378. fastcgi_temp_file_write_size 256k;
  379.  
  380.  
  381. }
  382.  
  383. # deny access to .htaccess files, if Apache's document root
  384. # concurs with nginx's one
  385. #
  386. location ~ /\.ht {
  387. deny all;
  388. }
  389.  
  390. location ~ /.git {
  391. deny all;
  392. }
  393. location ~ /.svn {
  394. deny all;
  395. }
  396. }
  397.  
  398.  
  399. # another virtual host using mix of IP-, name-, and port-based configuration
  400. #
  401.  
  402.  
  403. #server {
  404. # if ($host ~* ^domain\.com$) {
  405. # rewrite ^(.*) http://domain.com$1 permanent;
  406. # break;
  407. #}
  408. #}
  409.  
  410.  
  411. # listen 8000;
  412. # listen somename:8080;
  413. # server_name somename alias another.alias;
  414. # root html;
  415. # index index.html index.htm;
  416. #
  417. # location / {
  418. # try_files $uri $uri/ /index.html;
  419. # }
  420. #}
  421.  
  422.  
  423. # HTTPS server
  424. #
  425. #server {
  426. # listen 443;
  427. # server_name localhost;
  428. #
  429. # root html;
  430. # index index.html index.htm;
  431. #
  432. # ssl on;
  433. # ssl_certificate cert.pem;
  434. # ssl_certificate_key cert.key;
  435. #
  436. # ssl_session_timeout 5m;
  437. #
  438. # ssl_protocols SSLv3 TLSv1;
  439. # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  440. # ssl_prefer_server_ciphers on;
  441. #
  442. # location / {
  443. # try_files $uri $uri/ /index.html;
  444. # }
  445. #}
  446.  
  447.  
  448. `
  449.  
  450.  
  451. varnish/default.vcl
  452.  
  453. `
  454.  
  455. # This is a basic VCL configuration file for varnish. See the vcl(7)
  456. # man page for details on VCL syntax and semantics.
  457. #
  458. # Default backend definition. Set this to point to your content
  459. # server.
  460. #
  461. backend default {
  462. .host = "127.0.0.1";
  463. .port = "8080";
  464. .connect_timeout = 20s;
  465. .first_byte_timeout = 30s;
  466. .between_bytes_timeout = 20s;
  467. }
  468.  
  469. acl purge {
  470. "127.0.0.1";
  471. }
  472.  
  473. sub vcl_recv {
  474. # Allow purge requests
  475. if (req.request == "PURGE") {
  476. if (!client.ip ~ purge) {
  477. error 405 "Not allowed.";
  478. }
  479. ban("req.url ~ ^" + req.url + " && req.http.host == " + req.http.host);
  480. return(lookup);
  481. }
  482.  
  483. # Normalize content-encoding
  484. if (req.http.Accept-Encoding) {
  485. if (req.http.Accept-Encoding ~ "gzip") {
  486. # If the browser supports it, we'll use gzip.
  487. set req.http.Accept-Encoding = "gzip";
  488. }
  489. else if (req.http.Accept-Encoding ~ "deflate") {
  490. # Next, try deflate if it is supported.
  491. set req.http.Accept-Encoding = "deflate";
  492. }
  493. else {
  494. # Unknown algorithm. Remove it and send unencoded.
  495. unset req.http.Accept-Encoding;
  496. }
  497. }
  498.  
  499. #Don't cache admin or login pages
  500. if (req.url ~ "wp-(login|admin)" || req.url ~ "preview=true") {
  501. return (pass);
  502. }
  503.  
  504. #Don't cache logged in users
  505. if (req.http.Cookie && req.http.Cookie ~ "(wordpress_|wordpress_logged_in|comment_author_)") {
  506. return(pass);
  507. }
  508.  
  509. #Don't cache ajax requests, urls with ?nocache or comments/login/regiser
  510. if(req.http.X-Requested-With == "XMLHttpRequest" || req.url ~ "nocache" || req.url ~ "(control.php|wp-comments-post.php|wp-login.php|register.php)") {
  511. return (pass);
  512. }
  513.  
  514. # always pass through POST requests and those with basic auth
  515. if (req.http.Authorization || req.request == "POST") {
  516. return (pass);
  517. }
  518.  
  519. # Do not cache these paths
  520. if (req.url ~ "^/wp-cron\.php$" ||
  521. req.url ~ "^/xmlrpc\.php$" ||
  522. req.url ~ "^/wp-admin/.*$" ||
  523. req.url ~ "^/wp-includes/.*$" ||
  524. req.url ~ "\?s=") {
  525. return (pass);
  526. }
  527.  
  528. # Remove cookies and query string for real static files
  529. if (req.url ~ "^/[^?]+\.(gif|jpg|jpeg|swf|css|js|txt|flv|mp3|mp4|pdf|ico|png|gz|zip|lzma|bz2|tgz|tbz)(\?.*|)$") {
  530. unset req.http.cookie;
  531. set req.url = regsub(req.url, "\?.*$", "");
  532. }
  533.  
  534. # Define the default grace period to serve cached content
  535. set req.grace = 30s;
  536.  
  537. # Set client IP
  538. if (req.http.x-forwarded-for) {
  539. set req.http.X-Forwarded-For =
  540. req.http.X-Forwarded-For + ", " + client.ip;
  541. } else {
  542. set req.http.X-Forwarded-For = client.ip;
  543. }
  544. }
  545.  
  546.  
  547. sub vcl_hit {
  548. # purge cached objects from memory
  549. if (req.request == "PURGE") {
  550. purge;
  551. error 200 "Purged";
  552. }
  553. }
  554.  
  555.  
  556.  
  557.  
  558.  
  559. sub vcl_miss {
  560. # Set up invalidation of the cache so purging gets done properly
  561. if (req.request == "PURGE") {
  562. purge;
  563. error 200 "Purged.";
  564. }
  565. return (fetch);
  566. }
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573. sub vcl_fetch {
  574. # Dont cache admin
  575. if (req.url ~ "(wp-(login|admin|comments-post.php|cron.php))|login" || req.url ~ "preview=true" || req.url ~ "xmlrpc.php") {
  576. return (hit_for_pass);
  577. }
  578.  
  579. if (req.http.Cookie ~"(wp-postpass|wordpress_logged_in|comment_author_)") {
  580. return (hit_for_pass);
  581. }
  582.  
  583. # remove some headers we never want to see
  584. unset beresp.http.Server;
  585. unset beresp.http.X-Powered-By;
  586.  
  587. # only cache status ok
  588. if ( beresp.status != 200 ) {
  589. return (hit_for_pass);
  590. }
  591.  
  592. # If our backend returns 5xx status this will reset the grace time
  593. # set in vcl_recv so that cached content will be served and
  594. # the unhealthy backend will not be hammered by requests
  595. if (beresp.status == 500) {
  596. set beresp.grace = 60s;
  597. return (restart);
  598. }
  599.  
  600. # GZip the cached content if possible
  601. if (beresp.http.content-type ~ "text") {
  602. set beresp.do_gzip = true;
  603. }
  604.  
  605. # if nothing abovce matched it is now ok to cache the response
  606. set beresp.ttl = 24h;
  607. return (deliver);
  608. }
  609.  
  610.  
  611.  
  612.  
  613. sub vcl_error {
  614. if (obj.status == 503) {
  615. # set obj.http.location = req.http.Location;
  616. set obj.status = 404;
  617. set obj.response = "Not Found";
  618. return (deliver);
  619. }
  620. }
  621.  
  622.  
  623.  
  624.  
  625. sub vcl_deliver {
  626. # remove some headers added by varnish
  627. unset resp.http.Via;
  628. unset resp.http.X-Varnish;
  629. }
  630.  
  631.  
  632.  
  633.  
  634.  
  635. # commented-out copy of the default VCL logic. If you
  636. # redefine any of these subroutines, the built-in logic will be
  637. # appended to your code.
  638. # sub vcl_recv {
  639. # if (req.restarts == 0) {
  640. # if (req.http.x-forwarded-for) {
  641. # set req.http.X-Forwarded-For =
  642. # req.http.X-Forwarded-For + ", " + client.ip;
  643. # } else {
  644. # set req.http.X-Forwarded-For = client.ip;
  645. # }
  646. # }
  647. # if (req.request != "GET" &&
  648. # req.request != "HEAD" &&
  649. # req.request != "PUT" &&
  650. # req.request != "POST" &&
  651. # req.request != "TRACE" &&
  652. # req.request != "OPTIONS" &&
  653. # req.request != "DELETE") {
  654. # /* Non-RFC2616 or CONNECT which is weird. */
  655. # return (pipe);
  656. # }
  657. # if (req.request != "GET" && req.request != "HEAD") {
  658. # /* We only deal with GET and HEAD by default */
  659. # return (pass);
  660. # }
  661. # if (req.http.Authorization || req.http.Cookie) {
  662. # /* Not cacheable by default */
  663. # return (pass);
  664. # }
  665. # return (lookup);
  666. # }
  667. #
  668. # sub vcl_pipe {
  669. # # Note that only the first request to the backend will have
  670. # # X-Forwarded-For set. If you use X-Forwarded-For and want to
  671. # # have it set for all requests, make sure to have:
  672. # # set bereq.http.connection = "close";
  673. # # here. It is not set by default as it might break some broken web
  674. # # applications, like IIS with NTLM authentication.
  675. # return (pipe);
  676. # }
  677. #
  678. # sub vcl_pass {
  679. # return (pass);
  680. # }
  681. #
  682. # sub vcl_hash {
  683. # hash_data(req.url);
  684. # if (req.http.host) {
  685. # hash_data(req.http.host);
  686. # } else {
  687. # hash_data(server.ip);
  688. # }
  689. # return (hash);
  690. # }
  691. #
  692. # sub vcl_hit {
  693. # return (deliver);
  694. # }
  695. #
  696. # sub vcl_miss {
  697. # return (fetch);
  698. # }
  699. #
  700. # sub vcl_fetch {
  701. # if (beresp.ttl <= 0s ||
  702. # beresp.http.Set-Cookie ||
  703. # beresp.http.Vary == "*") {
  704. # /*
  705. # * Mark as "Hit-For-Pass" for the next 2 minutes
  706. # */
  707. # set beresp.ttl = 120 s;
  708. # return (hit_for_pass);
  709. # }
  710. # return (deliver);
  711. # }
  712. #
  713. # sub vcl_deliver {
  714. # return (deliver);
  715. # }
  716. #
  717. # sub vcl_error {
  718. # set obj.http.Content-Type = "text/html; charset=utf-8";
  719. # set obj.http.Retry-After = "5";
  720. # synthetic {"
  721. # <?xml version="1.0" encoding="utf-8"?>
  722. # <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  723. # "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  724. # <html>
  725. # <head>
  726. # <title>"} + obj.status + " " + obj.response + {"</title>
  727. # </head>
  728. # <body>
  729. # <h1>Error "} + obj.status + " " + obj.response + {"</h1>
  730. # <p>"} + obj.response + {"</p>
  731. # <h3>Guru Meditation:</h3>
  732. # <p>XID: "} + req.xid + {"</p>
  733. # <hr>
  734. # <p>Varnish cache server</p>
  735. # </body>
  736. # </html>
  737. # "};
  738. # return (deliver);
  739. # }
  740. #
  741. # sub vcl_init {
  742. # return (ok);
  743. # }
  744. #
  745. # sub vcl_fini {
  746. # return (ok);
  747. # }
  748. `
Advertisement
Add Comment
Please, Sign In to add comment