Title: Reverse Proxy Configuration
Last modified: October 22, 2024

---

# Reverse Proxy Configuration

 *  Resolved [jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)
 * (@jwinterfeld)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/)
 * Hi,
 * does the plugin respect a wordpress reverse proxy configuration? We are not able
   to authenticate with our algolia credentials. On pages without reverse proxy 
   the installation is working properly.
 * Can you name the endpoints that are requested during activation, like e.g. “auth.
   algolia.com”?
 * Thanks and have a nice day,
 * Jan

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

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 7 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18088374)
 * Hi [@jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)
 * We’re making use of [https://github.com/algolia/algoliasearch-client-php](https://github.com/algolia/algoliasearch-client-php)
   to handle all of the API client requests, specifically the 3.3.x release range
   [https://github.com/algolia/algoliasearch-client-php/tree/3.3.0](https://github.com/algolia/algoliasearch-client-php/tree/3.3.0)
 * Not sure how much you’d be able to get out of that for possible API endpoints.
   Algolia support themselves may be able to provide some information as well, to
   help with the reverse proxy details.
 *  Thread Starter [jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)
 * (@jwinterfeld)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18091079)
 * Hi Michael,
 * thank you!
 * Currently we are experiencing issues while authenticating against algolia using“
   WP Search with Algolia”. I think this is plugin related. Are you respecting proxy
   configurations from the wordpress config? (we double checked the credentials)
 * Perhaps this is the recommendation from Algolia: [https://support.algolia.com/hc/en-us/articles/17789246970641-How-do-I-use-Python-API-client-with-proxy](https://support.algolia.com/hc/en-us/articles/17789246970641-How-do-I-use-Python-API-client-with-proxy)
 * Thanks and have a nice day,
 * Jan
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 7 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18091458)
 * Until I’m told otherwise, I have to assume so, or at least we’re not intentionally
   ignoring/disregarding them. Closest I can think of for potentially integrating
   with reverse proxying would be the code in [https://github.com/WebDevStudios/wp-search-with-algolia/tree/main/includes/factories](https://github.com/WebDevStudios/wp-search-with-algolia/tree/main/includes/factories)
   where we’re doing some of the initial wiring up.
 * Admittedly I’m not that well versed with regards to reverse proxy thing and in
   response to that, how/where one could potentially change connection attempts 
   within the plugin’s code here.
 * This is also why I pointed to the package from Algolia where they’re maintaining
   a lot of code that we make use of externally, but don’t control internally. The
   question at that point would be how to best pass in custom values that pass through
   to that library.
    -  This reply was modified 1 year, 7 months ago by [Michael Beckwith](https://wordpress.org/support/users/tw2113/).
 *  Thread Starter [jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)
 * (@jwinterfeld)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18148539)
 * Thanks Michael.
 * I did some investigation and believe we should extend the `SearchConfig::create`
   method (reference: [SearchConfig.php#L15](https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/vendor_prefixed/algolia/algoliasearch-client-php/src/Config/SearchConfig.php#L15))
   to accept “hosts” and “headers” as parameters. Does that make sense to you?
 * Related Algolia Docs:
   – [https://www.algolia.com/doc/libraries/php/v3/customize/#use-a-custom-host](https://www.algolia.com/doc/libraries/php/v3/customize/#use-a-custom-host)–
   [https://www.algolia.com/doc/libraries/php/v3/customize/#add-http-headers-to-every-request](https://www.algolia.com/doc/libraries/php/v3/customize/#add-http-headers-to-every-request)
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 6 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18149029)
 * Overall, yes, but we can’t modify that `SearchConfig.php` file as that’s part
   of the composer package for the Algolia Search client.
 * That said, I know we have [https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/includes/factories/class-algolia-search-client-factory.php#L60-L86](https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/includes/factories/class-algolia-search-client-factory.php#L60-L86)
   where we’ve previously customized some details for the search config, and I believe
   we should be fine with adding in more conditionals. Perhaps we should even fill
   in all the missing items from [https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/vendor_prefixed/algolia/algoliasearch-client-php/src/Config/SearchConfig.php#L25-L39](https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/vendor_prefixed/algolia/algoliasearch-client-php/src/Config/SearchConfig.php#L25-L39)
 * Worth trying out in adding your values in the the `class-algolia-search-client-
   factory.php` around line 85 just to help confirm that things take like needed.
   If yes, then we can get an issue opened and a PR in place to fill in the missing
   config options.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18248698)
 * [@jwinterfeld](https://wordpress.org/support/users/jwinterfeld/) Did you ever
   get something working here, based on feedback?
 *  Thread Starter [jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)
 * (@jwinterfeld)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18254917)
 * [@tw2113](https://wordpress.org/support/users/tw2113/) thanks. We are still working
   on it. Currently we were able isolate the issue and reproduce it. Hopefully we
   will be able to provide further information within 2 weeks.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18256553)
 * Sounds good. Thanks for the update.
 *  Thread Starter [jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)
 * (@jwinterfeld)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18284458)
 * [@tw2113](https://wordpress.org/support/users/tw2113/) we resolved the issue 
   without code modification. After investigating the code we found the filter `
   algolia_http_client_options` in this file: [https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/includes/factories/class-algolia-http-client-interface-factory.php](https://github.com/WebDevStudios/wp-search-with-algolia/blob/main/includes/factories/class-algolia-http-client-interface-factory.php)
 * We resolved it by declaring a function in the theme functions.php file:
 *     ```wp-block-code
       if (! function_exists('dur_algolia_http_client_options')) :  function dur_algolia_http_client_options($options)  {    $options['CURLOPT_PROXY'] = WP_PROXY_HOST . ':' . WP_PROXY_PORT;    return $options;  }  add_filter('algolia_http_client_options', 'dur_algolia_http_client_options', 10, 1);endif;
       ```
   
 * My recommendation is to update the docs and explain the filter instead of modifying
   the plugin. What do you think?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [1 year, 4 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18284539)
 * Added [https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Proxy](https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Proxy)
   quick, at least based on your code above.
 * May still handle my filters idea from [https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18149029](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18149029)
   but that’s not needed today by any means.
 * Thanks for the followup [@jwinterfeld](https://wordpress.org/support/users/jwinterfeld/)

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

The topic ‘Reverse Proxy Configuration’ is closed to new replies.

 * ![](https://ps.w.org/wp-search-with-algolia/assets/icon-256x256.png?rev=2894668)
 * [WP Search with Algolia](https://wordpress.org/plugins/wp-search-with-algolia/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-search-with-algolia/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-search-with-algolia/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-search-with-algolia/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-search-with-algolia/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-search-with-algolia/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/reverse-proxy-configuration/#post-18284539)
 * Status: resolved