WordPress.org

Ready to get started?Download WordPress

Forums

WordPress HTTPS (SSL)
[resolved] 502 Proxy Error (19 posts)

  1. timbunch
    Member
    Posted 2 years ago #

    I have random 502 proxy errors after activating this plugin.

    Proxy Error
    
    The proxy server received an invalid response from an upstream server.
    The proxy server could not handle the request GET /.
    
    Reason: Error reading from remote server

    This is inconsistent behavior and does not happen on every page load. It ceases to happen when I deactivate the plugin.

    This appears to be a request time out issue. But I am unsure what could be causing it.

    It is not a new bug with the new release. It was happening before as well.

    http://wordpress.org/extend/plugins/wordpress-https/

  2. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey timbunch,

    If not on every page load, how often?
    When it happens, how long does it take for the server to respond (does it hang)?
    Does it occur on both HTTPS and HTTP pages?

    Thanks,
    Mike

  3. timbunch
    Member
    Posted 2 years ago #

    Hi Mike!

    It occurs randomly, sometimes repeatedly. On average, I'd say 1 in 20 page loads. However, when it starts to time out, it sort of gets hung like the server is busy.

    The server is definitely taking too long to respond, which I assume is why I'm getting the 502. The only requests I'm sending are to Google for a font download and analytics.

    It does appear to only happen on SSL pages.

    Also, this issue is browser independent. When it begins to hang up, it hangs up across the board. Likewise, when it clears up, it clears up across the board.

    Rackspace Cloud Sites is the host.

    It seems to be buggy in that sense.

  4. timbunch
    Member
    Posted 2 years ago #

    This is in my php errors log.

    [28-Nov-2011 18:28:10] PHP Warning:  in_array() [<a href='function.in-array'>function.in-array</a>]: Wrong datatype for second argument in .../wp-content/plugins/wordpress-https/wordpress-https.php on line 629
  5. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey timbunch,

    And if you refresh a HTTPS page with the plugin disabled, it never occurs?

    A 502 error is going to occur way before any assets like JavaScript or CSS are requested, so it's definitely not hanging while loading the site itself. The error is occurring somewhere on the hosts end. It generally comes from a a proxy server losing connection with the server it's proxying. Sometimes servers go through multiple proxies and if there is a connection loss anywhere in the chain, the error will occur. I'm pretty sure if it times out, you'll get 504 error instead.

    Thanks,
    Mike

  6. timbunch
    Member
    Posted 2 years ago #

    I have yet to get the 502 error with the plugin disabled.

    If the page is not pulling up, I can disable the plug in, hit refresh and the page will come up immediately. Then I can immediately re-enable the plugin and get the 502 error.

    It is bizarre to me also. With rackspace, a time out will usually say something like "no nodes available".

    Any ideas on that php error in my log?

  7. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey timbunch,

    Is it on pages that are being forced to HTTPS with the plugin? Can you get the error to occur on an HTTPS page that's not using Force SSL?

    As for the warning in the error log, that's not going to cause any problems. The in_array function will produce that warning if the second argument is an empty array. I should probably suppress that warning since it's pretty likely that that array will be empty.

    Thanks,
    Mike

  8. timbunch
    Member
    Posted 2 years ago #

    It only occurs on pages where HTTPS is forced. HTTP pages pull up fine while the HTTPS pages give me a 502.

  9. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey timbunch,

    What about HTTPS pages that aren't forced to HTTPS?

    Thanks,
    Mike

  10. timbunch
    Member
    Posted 2 years ago #

    I f I disable Force SSL Exclusively, I can successfully load the non-forced SSL pages as either HTTP or HTTPS (While the forced SSL pages are hanging). Good question.

  11. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey timbunch,

    Would you mind if I poked around with the plugin on your site? If not, I can tell you what steps to take to get the information I need, but it'll only take me a few minutes.

    Thanks,
    Mike

  12. timbunch
    Member
    Posted 2 years ago #

    I could provide some temporary access to the backend of the dev site. What's your email address?

  13. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Oh right, that's important, huh? :P

    mike[at]mvied[dot]com

  14. Mvied
    Member
    Plugin Author

    Posted 2 years ago #

    Hey timbunch,

    Your SSL Host is using a proxy that is not configured properly. The plugin (and WordPress) can never detect that the page is HTTPS, so it can't function properly. I've seen this on other users' sites and generally when this happens, pages that are forced to HTTPS go into a redirect loop because the plugin continuously tries to redirect to HTTPS since it doesn't think that the page is HTTPS. I imagine that the redirect loop error never makes it through the proxy so it appears to hang and you get a 502 error.

    Unfortunately, there's nothing I can do about that. If the plugin can't detect the page is HTTPS, the plugin simply can't function properly. Perhaps you can ask your hosting provider to take a look at it.

    Thanks,
    Mike

  15. timbunch
    Member
    Posted 2 years ago #

    That makes sense to me. I will approach it from that angle. You've built a top tier plugin for WordPress, and I truly appreciate the support you provide.

  16. stimsonm
    Member
    Posted 2 years ago #

    I am having a 502 proxy error only in the admin but seems very much like what you are dealing with. I am using this in wp-config: define('FORCE_SSL_ADMIN', true);

    its intermitent and i am using rackspace cloud sites as well.

    Did you solve this? If so what did you do, I'm desperate.

    Thanks

  17. timbunch
    Member
    Posted 2 years ago #

    There are two ways to solve this.

    1. Switch everything to SSL and stop using this plugin (which I did)
    2. Switch to a different product or web host (which I am making plans to do)

    Rackspace Cloud Sites has been too unstable for us and we cannot afford to go down for hours at a time, or deal with configuration issues with their poor SSL support.

  18. stimsonm
    Member
    Posted 2 years ago #

    Thanks for your response, yes in the brief time I've been there I've had little bits of outages and this proxy thing which I can't deal with so I'm switching to media temple they have a dedicated vps with more bandwidth and its cheaper and a full plesk control panel and root access, hopefully this will solve the issue, if not I'll be back. Good luck to you.

    Thanks

  19. mvincik
    Member
    Posted 1 year ago #

    Your other option is to add conditional coding around elements to have them switch to https. I have done this on many sites. I use the wordpress-https plugin which handles most of the plugin elements.

    You can get http watch pro which is an add-in for your browser which will tell you which elements are not being served in a secure manner.

    Anything else I hard code a switch like this:
    '
    <?php if ( !is_page('shopping-cart') ) { ?>
    <img src="http://www.yourwebsite.com/yourimage.jpg" />
    <?php } else { ?>
    <img src="https://www.yourwebsite.com/yourimage.jpg" />
    <?php } ?>
    '

    This code basically says if you are on any page except the /shopping-cart/ page do this, otherwise do this.

    You can rewrite that differently if it bothers you but this works for me. I preferred using !is_page excluding the one page rather than using is_page and including only the pages I want to have the https show up on.

    I don't have the proxy problem any more and I was able to eliminate a plugin so this worked. Hope it helps!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic