curl -s https://packagecloud.io/install/repositories/varnishcache/varnish41/script.deb.sh | sudo bash
sudo nano /usr/share/varnish/reload-vcl
var HelloMessage = React.createClass({ | |
render: function() { | |
return <div tabIndex="1" onBlur={this.onBlur}> | |
Hello <input type="text" value="wat"/> | |
</div>; | |
}, | |
onBlur: function(e) { | |
var currentTarget = e.currentTarget; |
Install docker CE ubuntu how sudo | |
# curl -sSL get.docker.io | sh |
Enabling URL token validation | |
Last updated December 15, 2016 | |
Token validation allows you to create URLs that expire. Tokens are generated within your web application and appended to URLs in a query string. Requests are authenticated at Fastly's edge instead of your origin server. When Fastly receives a request for the URL, the token is validated before serving the content. After a configurable period of time, the token expires. | |
Adding custom VCL | |
To enable token validation, you'll need to create a Varnish configuration named vcl_recv and add the following example code to it. | |
IMPORTANT: The ability to upload custom VCL code is disabled by default when you sign up. To enable this ability for your account, contact support@fastly.com and request it. | |
/* make sure there is a token */ | |
if (req.url !~ ".+\?.*token=(\d{10,11})_([^&]+)") { |
eval "local _prefix = ARGV[1];\nlocal _keys = redis.call('keys', _prefix);\nfor i, _key in ipairs(_keys) do\n redis.call('del', _key);\nend" 0 REGEX |