I've edited my post.
So seems to be because of your script or custom changes
Ok but where from do you know this with code 301 vers 307?
Ok what did i done:
1. my .htacces is dated 04. Dezembar 2015 (first time i used let's encrypt was 7. Juli 2016
2. I searched for "rewrite" with "grep -r "rewrite" /etc/ | grep https" and found only
/etc/nginx/sites-available/00_master.conf: rewrite .* https://$host:4443$request_uri redirect;
This "00_master.conf" is dated 29 juni 2016
3. i searched also in /var/www/ but found nothing special