I have a web application running and publicly available on http://example.com:8099
To run the application over HTTPS, the app documentation suggests that we use a standard reverse proxy because it does not natively support HTTPS. All the guides I found is about proxying with just a domain root and does not take the port into consideration.
To begin with, I'm not sure which port should I even listen to in the first place. Is it 443, or 8099?
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name example.com;
error_log /var/log/nginx/sonar-error.log;
access_log /var/log/nginx/sonar-access.log;
location / {
proxy_pass http://localhost:8099;
}
}
In my server (AWS EC2 instance), the application is also running at the same port http://localhost:8099
as in the domain.
I've tried different configurations and checked whether anything is logged in to these log files. But these were empty. So I don't think I'm doing it right.