This post is very close to what I am looking for. But what I am looking for is
letsencrypt.example.com should always be http
*.example.com should always be https
Using the solution from this post I can rewrite all http to https by
server {
listen 80;
server_name test.example.com;
rewrite ^ https://$http_host$request_uri? permanent;
}
and then onwards do
server {
listen 443 ssl;
...
Question
But how can I make sure that letsencrypt.example.com
remains at http port 80?