Nate G
Nate G
CDCloudflare Developers
Created by Nate G on 7/11/2024 in #general-help
A Record doesn't resolve
I have an A record pointing to my public ip address and it is not proxying through cloudflare. However when I check to see if it's connecting using a debug site it doesn't resolve to my host machine with port 80 (which is forwarded and open. Not blocked by ISP). I disabled my firewall and I can see this port open but it doesn't connect. I am at a complete loss here and have no idea how to resolve this.
2 replies
CDCloudflare Developers
Created by Nate G on 9/20/2023 in #workers-help
Worker to copy one subdomain to another
This is my current worker that is supposed to get everything from stats.mydomain.com/status/server and push it to status.mydomain.com. However, I get this error: Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. How do I fix this?
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
const url = new URL(request.url);

// Check if the incoming request is for status.gurzhiyfamily.com
if (url.hostname === 'status.mydomain.com') {
// Create a new request object to fetch content from stats.gurzhiyfamily.com/status/server
const newRequest = new Request('https://stats.mydomain.com/status/server', {
method: request.method,
headers: request.headers,
body: request.body
});

// Fetch the content and return as response
const response = await fetch(newRequest);
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: response.headers
});
}

// If not, proceed with the original request
return fetch(request);
}
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
const url = new URL(request.url);

// Check if the incoming request is for status.gurzhiyfamily.com
if (url.hostname === 'status.mydomain.com') {
// Create a new request object to fetch content from stats.gurzhiyfamily.com/status/server
const newRequest = new Request('https://stats.mydomain.com/status/server', {
method: request.method,
headers: request.headers,
body: request.body
});

// Fetch the content and return as response
const response = await fetch(newRequest);
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: response.headers
});
}

// If not, proceed with the original request
return fetch(request);
}
8 replies
CDCloudflare Developers
Created by Nate G on 9/20/2023 in #general-help
Cloudflare not loading all html elements
No description
1 replies
CDCloudflare Developers
Created by Nate G on 9/20/2023 in #general-help
I cannot add a app to the main domain, cannot add a tunnel to it, etc.
It always errors with 523 or other errors. I need my root domain to resolve in order to add dns records off of it for a status page, but I've been having multiple issues with this. I added it to a tunnel and pointed it to a wordpress site to see if it would resolve, but it didn't even load an error page, instead it said it took too long. Doing page rules and redirect rules haven't worked either. Am I missing something?
4 replies