Certbot: nginx config modification uses 301 and not 308

i think it is a potential bug that cerbot will modify nginx configuration files with a 301 for the redirect from http to https, as in this example:

if ($host = foo.example.org) {
        return 301 https://$host$request_uri;
} # managed by Certbot

i feel as though a 308 would be better suited for this, as a 301 will lose the body of a POST when it redirects. this was causing a problem on our server as this (automatically placed) 301 block superceded the 308 we had in place to handle POST bodies.

Hi @Mumonkan,

It might be better to post this on

if you can, although we can also ask the Certbot developers to comment on this here if you would prefer.

There's some prior history on this matter: