Skip to content

Instantly share code, notes, and snippets.

@cstrouse
Created November 2, 2020 17:06
Show Gist options
  • Save cstrouse/4bb1415d4437168d0e7219d7e0d7ecfe to your computer and use it in GitHub Desktop.
Save cstrouse/4bb1415d4437168d0e7219d7e0d7ecfe to your computer and use it in GitHub Desktop.
Add the following to wp-config.php to fix wp-cli warnings related to SSL and proxies on AWS (PHP Notice: Undefined index: HTTP_X_FORWARDED_PROTO in phar:///opt/bitnami/apps/wordpress/bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1197) : eval()'d code on line 114)
define( 'FORCE_SSL_ADMIN', true );
define( 'FORCE_SSL_LOGIN', true);
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){ $_SERVER['HTTPS']='on'; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment