I have a Raspberry Pi 4B running Raspberry Pi OS Lite/Debian 11 (64 bit version) with NGINX version 1.18.0 installed. NGINX is serving a small (~400KB) website, and I have my router set up to forward HTTP requests to the Raspberry Pi. From my local network, the site works just fine in all the browsers I've tried: Chrome, Edge, Safari, and iOS browsers.
However, Safari and iOS browsers fail to load the whole site when I try to visit it through the internet. In other words, there are no issues navigating to the site in Safari or on iOS using the local IP address for the Raspberry Pi, but when I navigate to the site using the site's domain name or the router's public IP address, the site only loads partially, and the rest times out. The site loads fine in Chrome and Edge, both locally and on the internet.
I understand Safari and all iOS browsers are based on WebKit and that Chrome and Edge use a different engine, and I have some sense that that might be a part of the issue, but I have no idea how to go about fixing it. I'm an amateur and pretty new to web development. My goal is to self-host a website from the Raspberry Pi and make it available to the internet, preferably via Safari as well as Chrome.
I've looked around on Stack Overflow and other forums for similar posts and didn't find any resolutions; apologies if I missed one and this is a redundant post though. I'd appreciate any insights or references! The site uses some fairly straightforward JavaScript for routing between views, and like I said, Safari renders it without any problems locally, so I don't think it's an issue with the site's resources. Maybe something to do with NGINX? Anyway, let me know if I should provide any configuration details or anything like that. Thanks!