https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • n

    Nosh

    02/14/2023, 9:45 PM
    hmm I'm not getting any output or logging anything when I hit the url
  • n

    Nosh

    02/14/2023, 9:46 PM
    I've created a route Route: emails.webnd.co.uk/* Zone: webnd.co.uk Does that look like it should do something if I just hit emails.webnd.co.uk?
  • c

    Chaika

    02/14/2023, 9:47 PM
    Not if it's an Worker Route, you'll need to create a record for it. For originless setups, CF Recommends
    AAAA
    emails.webnd.co.uk
    100::
    Proxied. Or just use a Worker Custom Domain
  • n

    Nosh

    02/14/2023, 9:49 PM
    yeah a custom domain will be easier i guess
  • n

    Nosh

    02/14/2023, 10:06 PM
    It's working now, thanks!
  • b

    Brazilionaire

    02/14/2023, 11:04 PM
    I have a CNAME (abc.com) to a lambda url (abc.execute-api.amazonaws.com) that enforces the hostname. I want to replace that with a worker. So I have something like:
    Copy code
    handle(request: Request) {
        const newRequest = new Request(request, {
            cf: {
                resolveOverride: "abc.com",
            },
        });
    
        return fetch("abc.execute-api.amazonaws.com", newRequest);
    }
    Which isn't working. Not sure if there's something wrong with that or it's just not something I can do with workers
  • d

    dave

    02/14/2023, 11:31 PM
    what's the end goal?
  • b

    Brazilionaire

    02/14/2023, 11:31 PM
    to have mTLS agreement between lambda and worker so cloudflare can't be bypassed
  • d

    dave

    02/14/2023, 11:32 PM
    you can throw API Gateway out completely, and use aws4fetch for that instead. https://github.com/mhart/aws4fetch/tree/master/example
  • d

    dave

    02/14/2023, 11:33 PM
    or if you want to use Lambda URLs instead (which I find have some convenient benefits, like being able to use route53 to load balance between regions and ARM/Intel Lambda functions), here's my example: https://github.com/Manouchehri/cloudflare-worker-to-aws-lambda-function-url-example/blob/main/src/index.ts
  • b

    Brazilionaire

    02/14/2023, 11:35 PM
    humm, that's an interesting approach. I like it. Might be easier to not have to deal with the certs on both ends
  • d

    dave

    02/14/2023, 11:36 PM
    mTLS agreement would still be cool to have
  • d

    dave

    02/14/2023, 11:36 PM
    https://developers.cloudflare.com/workers/runtime-apis/mtls/
  • d

    dave

    02/14/2023, 11:36 PM
    interesting...
  • d

    dave

    02/14/2023, 11:37 PM
    Can you do mTLS without API gateway though?
  • b

    Brazilionaire

    02/14/2023, 11:37 PM
    no, but I wouldn't have to
  • b

    Brazilionaire

    02/14/2023, 11:38 PM
    API gateway is the issue atm, anyone can go straight to it and bypass CF WAF
  • d

    dave

    02/14/2023, 11:38 PM
    so mTLS with a Worker would work, but at an extra cost. aws4fetch would remove the need for API gateway completely.
  • b

    Brazilionaire

    02/14/2023, 11:39 PM
    so your idea sounds much better bc it completely eliminates the need for mTLS and since it's a newer thing I'd also have to make sure it works in China
  • d

    dave

    02/14/2023, 11:41 PM
    you have access to CF in China?
  • b

    Brazilionaire

    02/14/2023, 11:43 PM
    yeah, we have enterprise account. Most things don't work 100% in China though
  • d

    dave

    02/14/2023, 11:43 PM
    and AWS in China too?
  • b

    Brazilionaire

    02/14/2023, 11:43 PM
    yep
  • k

    kian

    02/14/2023, 11:43 PM
    this is a cool thing
  • k

    kian

    02/14/2023, 11:43 PM
    i like it
  • d

    dave

    02/14/2023, 11:43 PM
    ah kk then yeah oddly my solution would probably be my favourite one too, even over mTLS. 😛
  • b

    Brazilionaire

    02/14/2023, 11:44 PM
    thanks btw 🙂
  • d

    dave

    02/14/2023, 11:44 PM
    np
  • d

    dave

    02/14/2023, 11:45 PM
    I've changed it up a little, but look at this too if you wanna route to multiple Lambda Function URL endpoints. 🙂 https://discord.com/channels/595317990191398933/779390076219686943/1072557208287596624
  • d

    dave

    02/14/2023, 11:47 PM
    This is what my route53 dashboard looks like. The reason I have duplicate entries for each region, is because one is for ARM (90%) and the other is for Intel (10%).
1...227122722273...2509Latest