Trouble Moving my Preprint to a Custom Domain

Hello All,

I am using AWS Lightsail and Apache to host a web app on a Static IP. I now want to move that web app to a custom domain that I own, such that when I enter that domain I am taken to my web app, with the domain in the address bar (rather than the static IP).

To achieve this, I implemented a reverse proxy using Nginx, however I still find that the address bar still shows the static IP. The script I am using for my reverse proxy is here:

server {
    listen 8081;
    location / {
        proxy_pass http://xx.xx.xx.xx/ops;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect http://xx.xx.xx.xx/ops;

From what I assume, the Nginx service is working. I don’t see any errors and sudo systemctl status nginx returns Fine. I also have an A record on my Cloudflare DNS provider pointing the domain root (@) to my static IP on which the Nginx service is hosted (same IP as the web app). When I try curl -I, I get:

HTTP/1.1 301 Moved Permanently
Date: Tue, 21 May 2024 11:42:22 GMT
Content-Type: text/html
Content-Length: 167
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Tue, 21 May 2024 12:42:22 GMT
Location: http://xx.xx.xx.xx/ops
Report-To: {"endpoints":[{"url":"https:\/\/\/report\/v4?s=7TeZ5KZpOPdntdFuk0R63mg%2FLnb%2BOgp9GvOsby5O%2BfWU%2FG
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 88744d7e2ae44a41-SIN
alt-svc: h3=":443"; ma=86400

Potential reasons for this problem:

  1. The web app is hosted on http://xx.xx.xx.xx/ops, while the static IP leads to a generic landing page.

  2. Something to do with the Open Preprint Service.

Any help would be appreciated.