Reverse proxy spring-boot microservices using subdomains in nginx on azure windows virtual machine
I have 3 microservices, 1 frontend website and 2 data proccessing microservices both running on different ports.
I have a virtual machine on azure and bought a domain and already set the A name to my IP address and it is redirecting well.
I have also installed the nginx windows version and the requests to port 80 serve the front end website.
I am trying to reverse proxy requests based on the incoming sub domain to a specific springboot microservice but I always get them serving the frontend site using Azure(https://hkrtrainings.com/microsoft-azure-fundamentals-training-for-az-900) . what might be my problem?
here is my nginx.conf (servers only)
listen 80;
server_name myserverdomain.com;
location / {
proxy_pass https://myotherserver.com/;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name test1.myserverdomain.com;;
location / {
proxy_pass http://127.0.0.1:8080;
}
}