server {
listen *:80;
server_name example.com;
proxy_set_header Host example.com;
location / {
rewrite ^(.*)$ https://example.com$1 permanent;
}
}
server {
listen *:443 ssl;
server_name example.com;
proxy_set_header Host example.com;
location / {
proxy_pass http://127.0.0.1:8080;
}
}