Fruitionsite with Cloudflare Workers Error 1034
๐Ÿ˜‰

Fruitionsite with Cloudflare Workers Error 1034

Date
Oct 1, 2022
Text
Tags
ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ…
์˜คํ”ˆ์†Œ์Šค
Cloudflare
SSL
Network

Cloudflare Workers DNS ์˜ค๋ฅ˜

ย 
notion image
Fruitionsite๋ผ๋Š” ์˜คํ”ˆ์†Œ์Šค๋ฅผ Cloudflare Workers๋กœ ๋ฐฐํฌํ•˜์˜€์œผ๋‚˜, ์ง€๋‚œ Vercel app ๋ฐฐํฌ๋•Œ์˜ ์˜ค๋ฅ˜์ฒ˜๋Ÿผ ํฌ์›Œ๋”ฉ์ด ์ •์ƒ์ ์œผ๋กœ ์•ˆ๋˜๋Š” ํ˜„์ƒ์ด ์ผ์–ด๋‚ฌ๋‹ค.
ย 
๐Ÿคฉ ๋‹คํ–‰ํžˆ ์ด๋ฒˆ์—” ์—๋Ÿฌ์ฝ”๋“œ๋ผ๋„ ์ค˜์„œ ๋‹คํ–‰์ด๋‹ค.
ย 

์„œ๋น„์Šค ์†Œ๊ฐœ

Fruitionsite๋Š” ๋…ธ์…˜ ํŽ˜์ด์ง€ ๊ณต์œ ์‹œ ํˆดํ‚ท, URL, CSS, JS๋ฅผ ์ปค์Šคํ…€ํ•˜์—ฌ ์ ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์„œ๋น„์Šค๋‹ค.
์ฒซ ํ™”๋ฉด๋ถ€ํ„ฐ ๊ธฐ์กด์˜ ์ง€์ €๋ถ„ํ•œ ๋…ธ์…˜ ํˆดํ‚ท์ด ์‚ฌ๋ผ์ง„ ๋ชจ์Šต์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.
notion image
ย 

์„œ๋น„์Šค ๋กœ์ง

notion image
1. Couldflare Workers์—์„œ Notion ํŽ˜์ด์ง€ ์ •๋ณด๋ฅผ ๊ทธ๋Œ€๋กœ ๊ฐ€์ ธ์˜ค๊ณ , 2. ํŽ˜์ด์ง€ ํ•˜๋‹จ์— ์ถ”๊ฐ€ HTML์š”์†Œ๋“ค์„ append ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ž‘๋™ํ•œ๋‹ค.
ย 

๊ฐ€์ด๋“œ ๋ฌธ์„œ ์ ์šฉ

  • Flexible SSL ์ ์šฉ ERROR
  • A Record 1.1.1.1(Cloudflare) ์ ์šฉ ERROR
  • CNAME RECORD 1.1.1.1(Cloudflare) ์ ์šฉ ERROR
  • Workers์˜ ์ ‘์† ๊ฒฝ๋กœ๋ฅผ ์ปค์Šคํ…€ ๋„๋ฉ”์ธ์˜ CNAME ์ ์šฉ(blog.over.ist) OK
ย 
๊ฐ€์ด๋“œ๋ฅผ ๋ชจ๋‘ ๋”ฐ๋ผํ–ˆ๋Š”๋ฐ, Cloudflare Worker ์ƒ์„ฑ๋ถ€ํ„ฐ ์˜ค๋ฅ˜๊ฐ€ ๋‚ฌ๋‹ค.
ย 

๋ฌธ์ œ ํ•ด๊ฒฐ ๊ณผ์ •

1. Preview) Mismatch between origin and baseUrl (dev)

notion image
ย 
๋‹คํ–‰ํžˆ ์˜คํ”ˆ์†Œ์Šค ์„œ๋น„์Šค๋ผ์„œ, ์ด์Šˆ์™€ Pull Requests๋ฅผ ๋จผ์ € ์ฐพ์•„๋ณด์•˜๊ณ , ์ด๋ฏธ ์†”๋ฃจ์…˜๋“ค์ด ์กด์žฌํ–ˆ๋‹ค.
ย 
1๏ธโƒฃ Workers API์— ํ•˜๋“œ์ฝ”๋”ฉ๋œ URL์˜ ๊ฒฝ๋กœ๊ฐ€ Preview ์•ฑ์˜ URL๊ณผ ๋‹ฌ๋ผ์„œ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ๋กœ ๋ฌธ์ œ
Dynamically set domainBaseURL
Updated Mar 22, 2023
ย 
2๏ธโƒฃ ๋…ธ์…˜ ์„ค์ •์—์„œ ์œ ์ €๋„ค์ž„์„ ๋“ฑ๋กํ•˜์—ฌ ์„œ๋ธŒ๋„๋ฉ”์ธ(username.notion.site)์„ ํ• ๋‹น๋ฐ›์€ ์œ ์ €์—๊ฒŒ ๋ฐœ์ƒํ•˜๋Š” ์ด์Šˆ.
1. ์œ ์ €๋„ค์ž„์ด ์žˆ๋Š” ์œ ์ €์˜ ๋…ธ์…˜ํŽ˜์ด์ง€๋Š” notion.so/{pageid} ์—์„œ ํŽ˜์ด์ง€ ๋‚ด์šฉ์„ ํ•˜๋‚˜๋„ ๊ฐ€์ ธ์˜ค์ง€ ์•Š๊ณ , 2. username.notion.site/{pageid} ์œผ๋กœ ๋‹ค์‹œ ์ ‘์†ํ•ด๋‹ฌ๋ผ๋Š” implement ํŽ˜์ด์ง€๋ฅผ ์ถœ๋ ฅํ•˜๊ฒŒ๋œ๋‹ค. 3. Frutionsite์—์„œ๋Š” ์ด ๊ฒฝ์šฐ์— ๋ฐ์ดํ„ฐ Fetching ๊ฒฝ๋กœ๋ฅผ ์ˆ˜์ •ํ•˜๋Š” ์˜ˆ์™ธ์ฒ˜๋ฆฌ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์•˜๋‹ค.
fix : new notion subdomain from www.notion.so/user to user.notion.site
Updated Aug 3, 2021
ย 
๐Ÿ˜ก ์™œ ๋จธ์ง€ ์•ˆํ•ด!!!
ย 

2. Cloudflare Error 1034

Cloudflare ๊ณต์‹ ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ… ๋ฌธ์„œ๋ฅผ ๋ณด๋ฉด, Fruitionsite ๊ฐ€์ด๋“œ์— ๋‚˜์™€์žˆ๋Š” 1.1.1.1 ํฌ์›Œ๋”ฉ์ด ๋ฌธ์ œ๋ผ๊ณ  ํ•œ๋‹ค.
์ผ๋ฐ˜์ ์ธ ์›์ธ ์ด์ œ ์ด์ „์— ๋„๋ฉ”์ธ์ดย 1.1.1.1์„ ๊ฐ€๋ฆฌํ‚ค๋„๋ก ํ–ˆ๋˜ ๊ณ ๊ฐ์—๊ฒŒ๋Š”ย 1034 ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๊ตฌ์„ฑ ์˜ค๋ฅ˜ ๋ฐ/๋˜๋Š” ๋‚จ์šฉ ๊ฐ€๋Šฅ์„ฑ์„ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•œ Cloudflare ์‹œ์Šคํ…œ์˜ ์ƒˆ๋กœ์šด ์—์ง€ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๊ธฐ๋Šฅ์œผ๋กœ ์ธํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋ฌธ์ œ ํ•ด๊ฒฐ DNS ๋ ˆ์ฝ”๋“œ๊ฐ€ ๊ท€์‚ฌ์˜ ํ†ต์ œ ํ•˜์— ์žˆ๋Š” IP ์ฃผ์†Œ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋„๋ก ํ•˜๊ณ , "์›๋ณธ ์—†๋Š”" ์„ค์ •์„ ์œ„ํ•ด ํ”Œ๋ ˆ์ด์Šคํ™€๋” IP ์ฃผ์†Œ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ์—๋Š” IPv6 ์˜ˆ์•ฝ ์ฃผ์†Œย 100::ย ๋˜๋Š” IPv4 ์˜ˆ์•ฝ ์ฃผ์†Œย 192.0.2.0์„ ์ด์šฉํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
ย 
ํ•œ๊ธ€ ์ž๋™๋ฒˆ์—ญ์ด ์•Œ์•„๋“ฃ๊ธฐ ์–ด๋ ค์šด๋ฐ, ์˜๋ฌธ ์›์–ด๋ฅผ ํ•ด์„ํ•˜๋ฉด 192.0.2.0์€ ๊ณต๊ณต๋ง์—์„œ ์“ธ ์ˆ˜ ์—†๋Š” originless ์ฃผ์†Œ์ธ๋ฐ, A๋ ˆ์ฝ”๋“œ๋กœ 1.1.1.1์„ ์“ธ ๊ฑฐ๋ฉด ์ฐจ๋ผ๋ฆฌ ์•„๋ฌด๊ฒƒ๋„ ์•ˆ ๊ฐ€๋ฆฌํ‚ค๋Š” ์ฃผ์†Œ๋ฅผ ์“ฐ๋ผ๊ณ  ํ•œ๋‹ค.
https://www.rfc-editor.org/rfc/rfc3330
ย 
โœ๏ธ
Solution : 1.1.1.1 ๋ง๊ณ  ๋‹ค๋ฅธ๊ฑฐ ์จ๋ผ.
ย 
Vercel์—์„œ๋Š” ์ปค์Šคํ…€ ๋„๋ฉ”์ธ์„ ์„ค์ •ํ•  ๋•Œ, ๋‚ด ๋„๋ฉ”์ธ์˜ A, CNAME ๋ ˆ์ฝ”๋“œ์— Vercel์˜ Gateway ์ฃผ์†Œ๋ฅผ ํฌ์›Œ๋”ฉํ•ด์ฃผ๋ฉด HTTP ํ—ค๋”์˜ Host ์ •๋ณด์— ๋”ฐ๋ผ ๊ฐœ์ธ ์•ฑ์œผ๋กœ ๋ผ์šฐํŒ…์„ ํ•ด์คฌ์—ˆ๋‹ค. ๋งˆ์น˜ ์•„ํŒŒ์น˜ ์„œ๋ฒ„์˜ย ๊ฐ€์ƒํ˜ธ์ŠคํŠธ์ฒ˜๋Ÿผ.
Cloudflare Workers๋„ ์˜›๋‚ ์—๋Š” ๊ทธ๋Ÿฐ ์‹์œผ๋กœ ์šด์˜ํ–ˆ์—ˆ๋‹ค๊ฐ€ ๋ฐ”๊พผ ๋“ฏ ํ•˜๋‹ค(?)
ย 

3. DNS_PROBE_FINISHED_NXDOMAIN

notion image
Cloudflare ๋‚ด๋ถ€ ์„ค์ •์œผ๋กœ ์ธํ•ด IP์ •๋ณด ์‘๋‹ต์ด ์•ˆ๋˜๋Š” ์˜ค๋ฅ˜
Cloudflare with Vercel ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ… ๋ฌธ์„œ์—์„œ์ฒ˜๋Ÿผ, Stricted-Full SSL mode ์ ์šฉํ•˜์—ฌ ํ•ด๊ฒฐ.
ย 

Enhancement

Try) ๋ฌธ์ œ์˜ A๋ ˆ์ฝ”๋“œ(1.1.1.1)๋ฅผ ์•„์˜ˆ ์ง€์›Œ๋ฒ„๋ ค๋„ ๋˜๋‚˜?

notion image
ย 

Result) ์„ฑ๊ณต์ 

notion image
ย 
ย 
๋‚ด ๋„คํŠธ์›Œํฌ ์ƒ์‹์—์„œ๋„ CNAME๋งŒ ๋ฐ”์น˜๋ฉด ๋˜๋Š”๊ฒŒ ๋‹น์—ฐํ•œ๊ฑธ ์ด๋ฏธ ์•Œ๊ณ ์žˆ์—ˆ๋Š”๋ฐ, ๋ฌด์ง€์„ฑ์œผ๋กœ ๊ณต์‹ ๊ฐ€์ด๋“œ์„ค์ •์„ ๋„ˆ๋ฌด ์‹ ๋ขฐํ•˜๋‹ค๊ฐ€ ์‚ฝ์งˆ์„ ๋” ํ•œ ์ผ€์ด์Šค์˜€๋‹ค.
์˜คํ”ˆ์†Œ์Šค๋Š” ๊ฐ€์ด๋“œ, Issue, Pull Requests๋Š” ๋ฌด์กฐ๊ฑด ํ•จ๊ป˜๊ฐ€๋Š” ๋ฌธ์„œ๋ผ๊ณ  ๋ด์•ผ๊ฒ ๋‹ค. ๋ฐฐํฌ ํ›„ ์˜์กด ํ™˜๊ฒฝ์˜ ๋ณ€ํ™”์— ๋”ฐ๋ผ ์˜ค๋ฅ˜๋„ ์žฆ๊ณ , ๊ทธ๊ฑธ ํ•ด๊ฒฐํ•˜๋ ค๋Š” ์‚ฌ๋žŒ๋“ค๋„ ๋งŽ๋‹ค.
ย 
์ด ๋ธ”๋กœ๊ทธ๋Š” ๋งŒ๋“ค๊ณ ๋‚˜๋‹ˆ ์ƒ๊ฐ๋ณด๋‹ค ๋„ˆ๋ฌด ๋ณ„๋กœ์—ฌ์„œ ์—†์• ๊ธฐ๋กœ ํ–ˆ๋‹ค.