AJ Danelz
AJ Danelz
CDCloudflare Developers
Created by AJ Danelz on 4/25/2023 in #pages-help
Confirm SSL will work before adding the CNAME when using the My DNS provider option.
ssl successfully secured my domain after the dns check finished and that seems to have convinced my boss.
5 replies
CDCloudflare Developers
Created by AJ Danelz on 4/25/2023 in #pages-help
Confirm SSL will work before adding the CNAME when using the My DNS provider option.
I will try that thank you!
5 replies
CDCloudflare Developers
Created by AJ Danelz on 4/13/2023 in #general-discussions
Can anyone help me understand and or
My thought process is it is just time to make a change and might as well start managing our DNS in Cloudflare, leveraging the benefits where possible or cost-effective.
4 replies
CDCloudflare Developers
Created by AJ Danelz on 4/13/2023 in #general-discussions
Can anyone help me understand and or
We are moving from SaaS vendors to our own static hosting, and Cloudflare pages was the right choice. We will eventually be moving other Github pages sites as well.
4 replies
CDCloudflare Developers
Created by AJ Danelz on 4/13/2023 in #general-discussions
Can anyone help me understand and or
The current position is moving away from google managed domains will add a layer of unnecessary complexity. While this sounds like added complexity since it is a separate service, in practice, it isn't any more complex?
4 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
const PATHS = {
zilla: "zilla",
mskProxies: "msk-proxies",
};

const SITES = {
[PATHS.zilla]: "zilla-docs.pages.dev",
[PATHS.mskProxies]: "msk-proxies-docs.pages.dev",
};

export default {
async fetch(request, env) {
const url = new URL(request.url);
const origin = url.hostname;

// Check if incoming hostname is a key in the SITES object
if (url.pathname.startsWith(`/${PATHS.zilla}/`) || url.pathname === `/${PATHS.zilla}`) {
console.log(`found: /${PATHS.zilla}/`);
const target = SITES[PATHS.zilla];
url.hostname = target;
}

if (url.pathname.startsWith(`/${PATHS.mskProxies}/`) || url.pathname === `/${PATHS.mskProxies}`) {
console.log(`found: /${PATHS.mskProxies}/`);
const target = SITES[PATHS.mskProxies];
url.hostname = target;
}

if (url.hostname != origin) {
console.log("proxying to new pages site: ", url);
return fetch(url.toString(), request);
}
console.log("No site found for: ", url);

return env.ASSETS.fetch(request);
},
};
const PATHS = {
zilla: "zilla",
mskProxies: "msk-proxies",
};

const SITES = {
[PATHS.zilla]: "zilla-docs.pages.dev",
[PATHS.mskProxies]: "msk-proxies-docs.pages.dev",
};

export default {
async fetch(request, env) {
const url = new URL(request.url);
const origin = url.hostname;

// Check if incoming hostname is a key in the SITES object
if (url.pathname.startsWith(`/${PATHS.zilla}/`) || url.pathname === `/${PATHS.zilla}`) {
console.log(`found: /${PATHS.zilla}/`);
const target = SITES[PATHS.zilla];
url.hostname = target;
}

if (url.pathname.startsWith(`/${PATHS.mskProxies}/`) || url.pathname === `/${PATHS.mskProxies}`) {
console.log(`found: /${PATHS.mskProxies}/`);
const target = SITES[PATHS.mskProxies];
url.hostname = target;
}

if (url.hostname != origin) {
console.log("proxying to new pages site: ", url);
return fetch(url.toString(), request);
}
console.log("No site found for: ", url);

return env.ASSETS.fetch(request);
},
};
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
updated worker code:
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
the third pages site being served: https://docs-portal.pages.dev/msk-proxies/next/
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
However, I like the _worker.js option better since it keeps everything in one place.
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
Also a the generic worker I added yesterday with a route of docs-portal.pages.dev/* started working today randomly so that is a viable option.
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
I am using this with a local _redirects file as well.
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
nice even the card works
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
oh cool Ill try this out and see what i can get to work. Thank you for all of the help!!
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
This is my last resort plan 😬
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
This whole experience will be a blog post in my future i think 😬
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
Unfortunately, it does not. It doesn't even persist across branches!!!! It is a good thought and one I have tried.
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
This root pages site is also where I am managing robots.txt and sitmaps and such
35 replies
CDCloudflare Developers
Created by AJ Danelz on 4/10/2023 in #pages-help
Setup docs site in Subdirectory of Existing Static Website
There will be a pages site at root (/) of my domain so i could just manage this code as a function on that pages site?
35 replies