For Workes & Pages, what is the name of the domain?
NA
What is the error number?
NA
What is the error message?
NA
What is the issue or error you’re encountering
NA
What steps have you taken to resolve the issue?
I am trying to figure out if we can setup maintenance mode to allow multiple IP’s to be able to access it. We already have the worker setup. I found this link which is basically identical to how our’s is configured
I have tested it few moments ago and the code is working perfectly fine.
I’ve added my local IP from my wired ISP.
Created a worker and deployed to a route over my domain for testing purpose.
When visited from my PC (wired connection), I get normal response from my Web server.
When I visited from my mobile phone (mobile data connection), I got the maintenance page from the Worker.
I’d suggest you to use the code from Github, since it’s modified and can support more than two IPs. Someone also asked this question in the comments field.
const white_list = [
'1.1.1.1',
'123.123.123.123' --> change to yours, add more 'xxx.xxx.xxx.xxx' coma separated if so
];
Code is here (just replace and add your IPs and modify the text and styling to satisfy your needs as well):
Otherway would be to setup the Access and use Zero Trust for such case: