Quantcast
Channel: Turning an Apache http site into secure https site via Nginx reverse proxy - Server Fault
Viewing all articles
Browse latest Browse all 4

Answer by Mark for Turning an Apache http site into secure https site via Nginx reverse proxy

$
0
0

You can solve the problem in your option #1 (which, as you said, is a much better approach) by setting the HTTP_X_FORWARDED_PROTO in your nginx config with

proxy_set_header X-Forwarded-Proto $scheme;

and configuring WordPress to recognize it by appending this line to wp-config.php

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {    $_SERVER['HTTPS'] = 'on';}

See also Wordpress support article for a variation of this solution.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>