0

I have two type servers, main and sub , let's say SERVER 1 as main and SERVER 2 and SERVER 3 as sub.

SERVER 1

will process everything server 2 & 3 Do.

SERVER 2, SERVER 3

will curl post info to SERVER 1 and SERVER 1 will process info and reply with the respond back to the poster.


QUESTION

how to make SERVER 1 identify the poster. I can't send the server name from server 2 & 3 as it can be manipulated.

Abdullah Salma
  • 560
  • 7
  • 20

2 Answers2

1

$_SERVER['REMOTE_ADDR'] gives you the IP the request came from.

Ryan Tuosto
  • 1,941
  • 15
  • 23
  • but to user it. I need to send this from server 2 & 3 to server 1, and it can be manipulated. the user of the servers can change `$_SERVER['REMOTE_ADDR']` into a IP as `string`. And SERVER 1 can't really know. – Abdullah Salma Jun 25 '17 at 21:43
0

It sounds like what you're really trying to do is prevent access from other hosts.

One way is to simply configure a firewall so that Server 1 can only be accessed from 2 and 3.

Another way is to use client certificates.

This validates that the request came from only hosts who are authorized (assuming nobody stole their certificate of course). You can always revoke the certificates if one is compromised.

Brad
  • 159,648
  • 54
  • 349
  • 530