• I’m trying to set up WordPress on a server that requires a proxy connection to connect to the internet. Here’s what I put in wp-config.php:

    /* Configure HTTP Proxy Server */
    define('WP_PROXY_HOST', 'xx.xx.xx.xx');
    define('WP_PROXY_PORT', '8080');
    define('WP_PROXY_USERNAME', 'xxxxx');
    define('WP_PROXY_PASSWORD', 'xxxxx');
    define('WP_PROXY_BYPASS_HOSTS', 'localhost');

    (I replaced real IP, username and password with xxx here for privacy reasons)

    Unfortunately, WordPress still can’t connect to the internet. The Site Health page displays this error:

    Your site is unable to reach www.ads-software.com at 198.143.164.251, and returned the error: cURL error 56: Received HTTP code 407 from proxy after CONNECT

    407 is a Proxy Authentication Required error.

    I checked the proxy’s IP, username and password many times, and it’s definitely correct. The same settings work when I use

    export http_proxy="https://xxxxx:[email protected]:8080"

    in the command line, and then download something using wget. It connects via proxy, and downloads the file correctly.

    I tried using a packet capture program to see what the connection between WordPress and the proxy looks like, and the headers look like this:

    CONNECT api.www.ads-software.com:443 HTTP/1.1
    Host: api.www.ads-software.com:443
    User-Agent: WordPress/5.2.4; https://xx.xx.xx.xx/
    Proxy-Connection: Keep-Alive
    Connection: close

    The reply from the proxy server is this:

    HTTP/1.1 407 authenticationrequired
    Date: Fri, 18 Oct 2019 11:31:00 GMT
    Content-Type: text/html
    Cache-Control: no-cache
    Content-Length: 4365
    Proxy-Connection: Keep-Alive
    Proxy-Authenticate: Negotiate
    Proxy-Authenticate: NTLM
    Proxy-Authenticate: Basic realm="McAfee Web Gateway"

    I think that there should have been a

    Proxy-Authorization: Basic xxxxxxxxxxxxxxx

    header in the first packet, but for some reason there isn’t anything like it. What should I do? Am I missing something obvious here?

    • This topic was modified 5 years, 4 months ago by mooogle.
    • This topic was modified 5 years, 4 months ago by mooogle.
    • This topic was modified 5 years, 4 months ago by mooogle. Reason: moved to the Fixing Wordpress forum
Viewing 6 replies - 1 through 6 (of 6 total)
  • This is not a WordPress issue as long as your WordPress works then the rest becomes a server configuration problem.

    Shouldn’t those defines be in the proxy’s config?

    The only thing I can think of that might help you is to see if something like W3 Total Cache might be able to assist with driving the proxy server but I can’t remember seeing anything exactly like that in that plugin.

    A better place for this kind of request would probably be your web host, the provider of your hardware, or the help forums at Stack Exchange.

    Thread Starter mooogle

    (@mooogle)

    Thanks for the reply! But the proxy is working well outside WordPress, only WordPress has a problem with it, so I think it’s unlikely that it’s a problem with the proxy’s configuration.

    (I actually posted this on Stack Exchange too)

    You need to bypass host www.ads-software.com are you the owner of www.ads-software.com? If you are not, your proxy cannot connect to it (the destination server must be prepared for the proxy otherwise it will not work)
    Wildcards https://techjourney.net/how-to-enable-use-proxy-server-for-wordpress-to-connect-internet/

    Thread Starter mooogle

    (@mooogle)

    Hi! Thanks for the reply, I actually followed the instructions you’ve linked, but it’s not working. I’m not the owner of www.ads-software.com, my wordpress installation needs connection to www.ads-software.com to install plugins and updates. Internet connection works through proxy, but the proxy doesn’t seem to work on wordpress.

    Having the same issue. We are actually using CNTLM proxy for linux, running on a Linux VM, which allows us to direct all proxy activity to the CNTLM instance running on port 3128. We do this to avoid needing to use credentials int he WordPress setup.

    It’s failing for us too. Somthing changed in Wordress. The local linux instance it runs on has no issues poking through for OS updates.

    I had the same problem. I set up a proxy on localhost, and all things worked fine except wordpress. I cannot install plugins. The error message shows Cannot build secure connection to www.ads-software.com(wp-admin/includes/install-plugins.php line:182)
    I guess the reason is that the plugin-installing site of www.ads-software.com is not allowed to visit by a proxy, since it may verify your address.
    And in the tutorial, you can see they added “*.www.ads-software.com” to the bypass list.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem setting up proxy server’ is closed to new replies.