server { listen 80; server_name test.com; rewrite ^(.*)$ https://${server_name}$1 permanent; }
server { listen 443 ssl; server_name test.com; }