I'm currently learning React to host a personal website (on an Ubuntu server) and am port forwarding it to allow access from the internet.
However, for security reasons, I'd like one or more pages to only be accessed on my LAN. If an external IP attempts to access it, I would like to refuse the request or return a 403 Forbidden code or something.
I'd rather not use JavaScript for this and do something with IP filtering; I feel that would be less secure than preventing it through the actual server software / OS.
I haven't found any resources regarding this problem on stack or otherwise, so I'm not sure if it's even possible.
If it's not, what would be a good alternative?
Thank you