본문 바로가기

Public Cloud/Cloudflare

(6)
[Cloudflare-CDN] HTTP Header를 무시하고 모든 콘텐츠 caching 하기 Caching Level 설정 Cloudflare 의 cache 정책은 기본적으로 파일 확장자를 기반으로 caching 을 수행한다. Cloudflare Edge Server 에서 caching 정책은 WEB GUI Dashboard 에서 간단히 설정할 수 있다. 경로 : Caching - Configuration - Caching Level No query string : querystring 이 없는 request 만 caching 한다. 동적콘텐츠는 caching 하지 않는다. - 예) GET /a.jpg - GET/a.jpg?t=asd123 과 같은 querystring 이 있는 request는 caching 하지 않는다. Ignore query string : querystring 을 무시하고 ..
[Cloudflare] CDN Cache 응답(Response Status)에 따른 HTTP 통신 파악하기 Cloudflare 에서 제공하는 Cache Respose Status 는 아래 참조 문서에서 확인할 수 있다. 참조 : https://developers.cloudflare.com/cache/concepts/default-cache-behavior/ Default Cache Behavior · Cloudflare Cache (CDN) docs Cloudflare respects the origin web server’s cache headers in the following order unless an Edge Cache TTL page rule overrides the headers. developers.cloudflare.com cloudflare Cache Respose Status HIT The..
[Cloudflare] ColoCode를 Logstash에서 좌표값 Field 추가 하기 Logstash Filter에 translate 값 사용 logstash config filter { translate { regex => true dictionary_path => "/opt/cf-edge-location/cloudflare-edge-locations.json" field => "ColoCode" } } cloudflare-edge-locations.json 참조 : https://www.npmjs.com/package/cloudflare-edge-locations#json-lookup 실제 Edge ColoCode와 다른점이 있어 https://www.cloudflarestatus.com/ 를 보며 수정했음. json, csv 모두 사용가능 더보기 { "IAD": { "city": "..
[Cloudflare] Spectrum Logpush 설정하기(azure) Cloudflare - Analytics - Logs - Add Logpush job Spectrum events 선택 log에 포함 하고 싶은 field 값 선택 destination 에 Azure 선택 SAS URL(공유 액세스 토큰) 입력 Azure - 스토리지 계정 - 컨테이너 - 공유액세스 토큰 발급할 토큰의 유효시간은 5년 이상으로 한다. 권한은 읽기를 제외한다. 이후 Azure 컨테이너에 ownership-challenge-***.txt 파일이 생성 되며 파일 내용의 코드를 복사하여 마무리한다.
[Cloudflare] 4차 도메인(sub-subdomain) SSL/TLS 인증서 적용 하기 개요 기본적으로 클라우드플레어의 Universal 인증서는 4차 도메인(*.*.example.com) 은 적용 되지 않는다. Universal 인증서를 통한 4차 도메인 proxied 적용 후 다음과 같은 오류를 볼수 있다. "net:: ERR_CERT_COMMON_NAME_INVALID" 4차 도메인 SSL 인증서 적용을 위하여 Advance 인증서를 사용하여야 하며 유료이다. Advanced SSL 인증서 적용 클라우드플레어 도메인 - SSL/TLS - Edge Certificates - Order Advanced Certificate "Certficate Hostnames" 항목에 dev.test.example.com 의 경우 *.test.example.com 과 같이 입력 한다. 3차 도메인이 여..
[Cloudflare] API email, zone_ip, api_key 정보 필요 Logpush Logpush 설정 정보. CF -> Analutics -> Logs # GET JOB ID curl -s -H "X-Auth-Email: ${email}" -H "X-Auth-Key: ${api_key}" 'https://api.cloudflare.com/client/v4/zones/'${zone_id}'/logpush/jobs' | jq . { "errors": [], "messages": [], "result": [ { "id": {JOB ID}, "dataset": "firewall_events", "frequency": "high", "kind": "", "enabled": true, "name": null, "logpull_o..