Title: Behind reverse proxy
Last modified: May 6, 2022

---

# Behind reverse proxy

 *  [jadjay](https://wordpress.org/support/users/jadjay/)
 * (@jadjay)
 * [4 years ago](https://wordpress.org/support/topic/behind-reverse-proxy/)
 * Hi,
 * Your code doesn’t set IP address when behind a Reverse Proxy
 * To get this done :
 *     ```
       diff wp-content/plugins/wps-limit-login/classes/plugin.php wp-content/plugins/wps-limit-login/classes/plugin.php_modif
       1017a1018
       >               /*
       1019a1021,1024
       >               }
       >                */
       >               if ( isset( $_SERVER[$this->get_option( 'wps_limit_login_client_type' )] ) ) {
       >                       return $_SERVER[$this->get_option( 'wps_limit_login_client_type' )];
       ```
   
 * Thanks to put this in your code,
 * Regards,

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

 *  [Akseli Palén](https://wordpress.org/support/users/akselipalengmailcom/)
 * (@akselipalengmailcom)
 * [4 years ago](https://wordpress.org/support/topic/behind-reverse-proxy/#post-15659864)
 * I also have problems with the reverse proxy setup. The plugin thinks that all
   the login attempts are coming from the same IP – the reverse proxy. Therefore
   I cannot access my site control panel because the constant brute-force login 
   attempts.
 *  Thread Starter [jadjay](https://wordpress.org/support/users/jadjay/)
 * (@jadjay)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/behind-reverse-proxy/#post-15709873)
 * Would you be so kind to review this piece of code please?
 *  [bnbc](https://wordpress.org/support/users/bnbc/)
 * (@bnbc)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/behind-reverse-proxy/#post-15797668)
 * Hello [@jadjay](https://wordpress.org/support/users/jadjay/), i don’t understand
   where to put your code in file plugin.php.
 * What is the function ?
    Is it a replacement or an addition ?
 * Thks for you reply and hope it will fix officialy in the plugin.
 *  Thread Starter [jadjay](https://wordpress.org/support/users/jadjay/)
 * (@jadjay)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/behind-reverse-proxy/#post-15799356)
 * Hello [@bnbc](https://wordpress.org/support/users/bnbc/),
 * You need to learn how to use diff
    - [https://en.wikipedia.org/wiki/Diff](https://en.wikipedia.org/wiki/Diff)
    - [https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html)
 * Lines 1017 to 1024
 * As this plugin isn’t updated, the lines are corrects.
 *  Thread Starter [jadjay](https://wordpress.org/support/users/jadjay/)
 * (@jadjay)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/behind-reverse-proxy/#post-15799456)
 * Ok [@bnbc](https://wordpress.org/support/users/bnbc/) I’ll help you
 *     ```
       $ cat > ~/patch <<EOF
       1017a1018
       >               /*
       1019a1021,1024
       >               }
       >                */
       >               if ( isset( $_SERVER[$this->get_option( 'wps_limit_login_client_type' )] ) ) {
       >                       return $_SERVER[$this->get_option( 'wps_limit_login_client_type' )];
       EOF
       ```
   
 * then cd to your root directory
 *     ```
       $ cp wp-content/plugins/wps-limit-login/classes/plugin.php wp-content/plugins/wps-limit-login/classes/plugin.php_orig # save the original file for security
       $ patch wp-content/plugins/wps-limit-login/classes/plugin.php ~/patch
       ```
   
 * That’s done.

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

The topic ‘Behind reverse proxy’ is closed to new replies.

 * ![](https://ps.w.org/wps-limit-login/assets/icon-256x256.jpg?rev=1832086)
 * [WPS Limit Login](https://wordpress.org/plugins/wps-limit-login/)
 * [Support Threads](https://wordpress.org/support/plugin/wps-limit-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wps-limit-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wps-limit-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wps-limit-login/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [jadjay](https://wordpress.org/support/users/jadjay/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/behind-reverse-proxy/#post-15799456)
 * Status: not resolved