Nginx reverse proxy to multiple subdomains on the same VPS with cloudflare DNS
I am running a Gitea server on a vps mapped to a sub-domain ‘git.domain.com’, which works fine. However, I have tried to add a Verdaccio server (private npm registry) alongside it, using Nginx as a reverse proxy. However, I can’t access the Verdaccio server through its subdomain ‘npm.domain.com’, it just serves the gitea server. Note I am using cloudflare as a DNS and have tried turning off proxy + cache. Note that I can access verdaccio through localhost, and nginx passes to verdacio if curled to the direct IP of the server:
curl --header 'Host: npm.domain.com' [ip]
rather than the domain name.