Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Switching between HTTPS and HTTP domains #41

Closed
jradxl opened this issue Feb 14, 2019 · 2 comments
Closed

Switching between HTTPS and HTTP domains #41

jradxl opened this issue Feb 14, 2019 · 2 comments

Comments

@jradxl
Copy link

jradxl commented Feb 14, 2019

Hello and thanks for your plugin, which I have working with a slight addition fix.
I'm writing this in case it's a feature that could be added.
My website is available as https (let's encrypt) on my own domain into a Nginx reverse proxy.
The proxy relays the connection to a http 192.168.2.x server which runs WordPress.
I can connect to my WP instance from my laptop on my local LAN via http and of course connect via https from the internet (using my phone's 4G network).
It works except for layout issues via https.

To fix this https issue, I add the following code into wp-config.php

$_SERVER['HTTPS'] = 'off';
if ( (!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) || 
(!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) 
{ $_SERVER['HTTPS'] = 'on'; }

I notice that your configuration pages requires only the Domain to be entered, and not http://domain.com or https://domain.com
I was wondering if such a change would avoid the need for the additional code.
Unless there is a better way.
Thanks
John

@jradxl jradxl changed the title Switching between HTTPS and HTTP domaons Switching between HTTPS and HTTP domains Feb 14, 2019
@straube
Copy link
Owner

straube commented Feb 14, 2019

Hey John, I think this is a valid addition. Have you taken a look at this other issue #31? Do you think that protocol setting with Force HTTP, Force HTTPS, and Auto options would work in this case?

@straube
Copy link
Owner

straube commented Mar 8, 2019

@jradxl I released a new version (0.10.0) that includes a new option to set the protocol for a given domain. You can set it to http, https or auto. This last one will keep the protocol from the current domain, whatever it is http or https.

Let me know in case that update doesn't help you.

@straube straube closed this as completed Mar 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants