Title: Problem setting up proxy server
Last modified: October 18, 2019

---

# Problem setting up proxy server

 *  [mooogle](https://wordpress.org/support/users/mooogle/)
 * (@mooogle)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/)
 * 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 WordPress.org 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="http://xxxxx:xxxxx@xx.xx.xx.xx: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.wordpress.org:443 HTTP/1.1
       Host: api.wordpress.org:443
       User-Agent: WordPress/5.2.4; http://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 6 years, 5 months ago by [mooogle](https://wordpress.org/support/users/mooogle/).
    -  This topic was modified 6 years, 5 months ago by [mooogle](https://wordpress.org/support/users/mooogle/).
    -  This topic was modified 6 years, 5 months ago by [mooogle](https://wordpress.org/support/users/mooogle/).
      Reason: moved to the Fixing Wordpress forum

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [JNashHawkins](https://wordpress.org/support/users/jnashhawkins/)
 * (@jnashhawkins)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12043114)
 * 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](https://wordpress.org/support/users/mooogle/)
 * (@mooogle)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12043139)
 * 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)
 *  [autotutorial](https://wordpress.org/support/users/autotutorial/)
 * (@autotutorial)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12043212)
 * You need to bypass host wordpress.org are you the owner of wordpress.org? 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/](https://techjourney.net/how-to-enable-use-proxy-server-for-wordpress-to-connect-internet/)
 *  Thread Starter [mooogle](https://wordpress.org/support/users/mooogle/)
 * (@mooogle)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12049032)
 * Hi! Thanks for the reply, I actually followed the instructions you’ve linked,
   but it’s not working. I’m not the owner of wordpress.org, my wordpress installation
   needs connection to wordpress.org to install plugins and updates. Internet connection
   works through proxy, but the proxy doesn’t seem to work on wordpress.
 *  [jbunston](https://wordpress.org/support/users/jbunston/)
 * (@jbunston)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12123494)
 * 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.
 *  [zfscgy](https://wordpress.org/support/users/zfscgy/)
 * (@zfscgy)
 * [6 years ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12625670)
 * 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 wordpress.org(wp-admin/includes/install-plugins.
   php line:182)
    I guess the reason is that the plugin-installing site of wordpress.
   org is not allowed to visit by a proxy, since it may verify your address. And
   in the tutorial, you can see they added “*.wordpress.org” 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 1 participant
 * Last reply from: [zfscgy](https://wordpress.org/support/users/zfscgy/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/problem-setting-up-proxy-server/#post-12625670)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
