cdn – cloudfront + wordpress redirecting to the original URL

I work on the website It's a wordpress site.

I configure this cloudfront for to serve the previously mentioned site.

Some URLs such as work correctly, but is being redirected to

I set the origin on the cloud front on and HTTPS only.

We have this rule on nginx

server {
listen to 80;
access_log /var/log/nginx/wordpress-access.log;
error_log /var/log/nginx/wordpress-error.log;
rewrite ^ https: // $ host $ request_uri? permanent;

I do not know why I get 301 only at the root of the wordpress site.