Advertisement
Guest User

Untitled

a guest
Aug 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.82 KB | None | 0 0
  1. map http://example-cdn.com http://example.com:8888 \
  2.    @plugin=cachekey.so \
  3.    @pparam=--capture-prefix=/(.*)-cdn.com.*$/$1/ \
  4.  
  5.  
  6.  
  7. $ cat http.txt
  8. GET /path/file?a=1&geo=a,b,c HTTP/1.1
  9. Host: example-cdn.com
  10.  
  11.  
  12. $ nc 127.0.0.1 8080 < http.txt
  13. HTTP/1.1 200 OK
  14. Server: ATS/9.0.0
  15. Date: Tue, 21 Aug 2018 21:40:44 GMT
  16. Content-type: text/html
  17. Content-Length: 3
  18. Cache-Control: max-age=10, public
  19. Age: 0
  20. Connection: keep-alive
  21.  
  22.  
  23.  
  24.  
  25.  
  26. [Aug 21 14:40:40.903] {0x7fffb57a4380} DIAG: (cachekey) cachekey/configs.cc:419:init() processing --capture-prefix=/(.*)-cdn.com.*$/$1/
  27. [Aug 21 14:40:40.903] {0x7fffb57a4380} DIAG: (cachekey) cachekey/pattern.cc:335:compile() compiling pattern:'(.*)-cdn.com.*$', replace: true, replacement:'$1'
  28. [Aug 21 14:40:40.903] {0x7fffb57a4380} DIAG: (cachekey) cachekey/plugin.cc:153:TSRemapNewInstance() remap plugin initialized
  29. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/cachekey.cc:208:CacheKey() setting cache key from a remap plugin
  30. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/cachekey.cc:219:CacheKey() using remap uri 'http://example-cdn.com/path/file?a=1&geo=a,b,c'
  31. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/pattern.cc:277:replace() replacing:'$1' in pattern:'(.*)-cdn.com.*$', subject:'example-cdn.com:80'
  32. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/pattern.cc:309:replace() replacing '$1' with 'example'
  33. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/pattern.cc:319:replace() replacing '$1' resulted in 'example'
  34. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/cachekey.cc:358:appendPrefix() added host:port capture prefix, key: '/example'
  35. [Aug 21 14:40:44.450] {0xb000c000} DIAG: (cachekey) cachekey/cachekey.cc:704:finalize() finalizing cache key '/example/path/file?a=1&geo=a,b,c' from a remap plugin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement