I have reviewed my Nginx configurations, and they are identical across both virtual hosts. For reference, I have attached configuration snapshots to confirm that no mistakes were made.
To address the common concerns:
The server_name directive is correctly set for both domains.
There is no conflicting or greedy server_name directive in another virtual host.
The correct data directory is specified.
Nginx has been properly reloaded/restarted after applying the configurations.
Individually, all modules work fine when executed separately. However, when running everything at once using a bash script, the issue occurs.
Before these snapshots, I see no mentions from your side, that you were using the reverse proxy functionality through nginx.
That adds several other views.
The “common concerns” from above, those are now common concerns for the “proxy_pass” destination, that you have running on “http://localhost:7502”, and not alone for your nginx configuration.
If they are both supposed to show different content from each other, … do you really intend to send traffic for both of them, towards “http://localhost:7502”, i.e. towards the exact same port?
Or did you intend to send one to 7502, another to 7503, … and so on?
Based on the new information (e.g. “reverse proxy”), I would now be suggesting you to look for the cause of the problem, at the the destination (or application), that you’re running on “http://localhost:7502”, as that one likely is the culprit, and giving nginx “incorrect” information, that nginx then passes on to Cloudflare.
Thank you for your analysis. I should clarify that I’m actually using two completely separate servers, not just one. I only shared the nginx config snapshots for reference.
To be more specific:
app.scematics.xyz (along with its subdomains) is hosted on one Ubuntu server
eu-app.scematics.xyz (with its subdomains) is hosted on an entirely different server
While both configurations use port 7502, they’re completely different environments. In Cloudflare’s DNS settings, app-import.scematics.xyz points to the IP address of the first server, while eu-app-import.scematics.xyz points to the IP address of the second server.
So even though the port numbers are the same (7502), they’re on different machines with different IP addresses. That’s why I didn’t think the port number itself would be causing any conflicts, since they’re completely separate systems.