A
A
Alexander Vladimirovich2014-12-26 12:58:31
PHP
Alexander Vladimirovich, 2014-12-26 12:58:31

How to define remote_addr in virtual box behind NAT?

There is a computer win7 in which virtualbox (debian nginx php) is installed in order to develop php scripts.
NAT is selected in the network settings and port 80 is forwarded.
PHP $_SERVER['REMOTE_ADDR'] all the time '10.0.2.2'
how to get the real REMOTE_ADDR of the client?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Vladimirovich, 2014-12-26
@polyanin

from the command line, execute
VBoxManage modifyvm "virtual_machine_name" --nataliasmode1 proxyonly
command line must be run not from the admin, but from under your user. the virtual machine must be stopped.

X
xmoonlight, 2014-12-26
@xmoonlight

mod_rpaf
ngx_http_realip_module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question