Php or Apache autoreference of the server without using ip public

0

Hello, I am trying to reference by header("Location: http://127.0.0.1:8086") to the same server but different port without using the public ip because only port 80 I have it published for security reasons because the application of port 8086 has no access system (login) . The problem is that when accessing from any other machine that is not the server when redirecting it looks for the localhost of the machine that accesses not the one of the server.

If this is not possible with php or apache, what do you suggest?

    
asked by David 07.06.2017 в 15:10
source

2 answers

1

From what I understand of your question, what you want to do is that the requests arrive at port 8086, passing first through a server that would be in charge of authentication.

What you can do is put a php script on port 80 that sent the requests to address 127.0.0.1:8086 using cURL:

link

This would allow you to control in the firewall of the machine that port 8086 can not be accessed from outside.

    
answered by 07.06.2017 / 17:40
source
0

I think what you're looking for is the value of the variable

$ _ SERVER ['SERVER_ADDR']

This returns the IP of the server that executes the script, as it says in the PHP documentation link

    
answered by 07.06.2017 в 16:36