0013810: Incorrect IP displayed in tine when operating behind reverse proxy #6829

Open
Gloirin opened this Issue Jun 9, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@Gloirin

Gloirin commented Jun 9, 2018

Reported by estradis on 29 Mar 2018 13:53

Version: git master

Tine uses $_SERVER['REMOTE_ADDR'] to identify connected client. When tine is operated behind a reverse proxy, the client ip address will be from the proxy, not from the real client. Although this is technically correct, it makes the column 'Last login from' useless when there is only the address from the reverse proxy displayed. (See screenshot)

Not sure what solution is to recommend, but I'm able to provide a workaround for this issue. (See additional information)

Additional information: Fortunatly there is a quick and dirty workaround possible.

1st:
In php.ini set the following line:
auto_prepend_file = "/usr/share/php/prepend.php"

2nd:
In prepend.php insert the following code:
<?php
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$_SERVER['PROXY_ADDR'] = $_SERVER['REMOTE_ADDR'];
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
};
?>

Now the correct IP address will be displayed in tine.

@estradis

This comment has been minimized.

Show comment
Hide comment
@estradis

estradis Jun 13, 2018

@Gloirin : I'm missing the screenshot. Maybe you have forgotten to transfer it from manits?

@Gloirin : I'm missing the screenshot. Maybe you have forgotten to transfer it from manits?

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 15, 2018

@estradis : Hey, the migration tool could not do transfer screenshots.

Gloirin commented Jun 15, 2018

@estradis : Hey, the migration tool could not do transfer screenshots.

@estradis

This comment has been minimized.

Show comment
Hide comment
@estradis

estradis Jun 28, 2018

Found the screenshot again

2018-03-29 15_32_59-172 16 30 149 - tine behind rproxy

Found the screenshot again

2018-03-29 15_32_59-172 16 30 149 - tine behind rproxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment