If WordPress is hosted behind a reverse proxy that provides SSL, but is hosted itself without SSL. These options will initially send any requests into an infinite redirect loop. To avoid this, you may configure WordPress to recognize the HTTP_X_FORWARDED_PROTO header (assuming you have properly configured the reverse proxy to set that header).
Place code at the beginning of the wp-config.php.
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) $_SERVER['HTTPS']='on'; else $_SERVER['HTTPS']='off';
link: https://wordpress.org/support/article/administration-over-ssl/Posted in Nginx, WordPress