[wp-trac] [WordPress Trac] #43698: 4.9.5 broke site behind load balancer, forwards to localhost

WordPress Trac noreply at wordpress.org
Tue Dec 1 11:05:16 UTC 2020


#43698: 4.9.5 broke site behind load balancer, forwards to localhost
--------------------------+----------------------
 Reporter:  ssuess        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  4.9.5
 Severity:  major         |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Description changed by SergeyBiryukov:

Old description:

> I have 2 wordpress web servers behind a load balancer. When updating from
> 4.9.4 to 4.9.5, these sites broke if accessed from the main domain (but
> continue to be accessible if I use their alternate addresses which is
> obvi not possible for our end users). Instead of the site loading by
> going to the main domain https://example.com, everyone who accesses the
> domain is instead directed to https://localhost.
>
> As I said, if someone accessed https://wp1.example.com or
> https://wp2.example.com (the direct addresses), the sites work. For now,
> I have reverted to 4.9.4 which fixes the problem, but I would like to
> figure out a long term fix. Any suggestions?
>
> FYI inside my wp-config files I am using these directives:
>
> define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
> define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
>
> Which I need in place to be able to address the machines directly as well
> as having them work with the main domain via the load balancer.
>
> I think I found the changeset responsible for this behaviour
> ([https://core.trac.wordpress.org/changeset/42894]) but still have no
> workable fix.

New description:

 I have 2 wordpress web servers behind a load balancer. When updating from
 4.9.4 to 4.9.5, these sites broke if accessed from the main domain (but
 continue to be accessible if I use their alternate addresses which is obvi
 not possible for our end users). Instead of the site loading by going to
 the main domain https://example.com, everyone who accesses the domain is
 instead directed to https://localhost.

 As I said, if someone accessed https://wp1.example.com or
 https://wp2.example.com (the direct addresses), the sites work. For now, I
 have reverted to 4.9.4 which fixes the problem, but I would like to figure
 out a long term fix. Any suggestions?

 FYI inside my wp-config files I am using these directives:
 {{{
 define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
 define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
 }}}
 Which I need in place to be able to address the machines directly as well
 as having them work with the main domain via the load balancer.

 I think I found the changeset responsible for this behaviour: [42894] but
 still have no workable fix.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43698#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list