Portal Home > Knowledgebase > Reverse Proxy service > Compile nginx and configure mod_real_ip for nginx to work with RP service


Compile nginx and configure mod_real_ip for nginx to work with RP service




login to ssh as root user and execute following commands

* download latest stable version of nginx from nginx.org/en/download.html

wget http://nginx.org/download/nginx-1.0.11.tar.gz

tar -xf nginx-*

cd nginx-*

./configure --prefix=/usr/local/nginx --with-http_realip_module

make && make install

* make sure to install pcre-devel and openssl-devel

 

now copy nginx default conf to /etc/nginx

mkdir -p /etc/nginx

cp /usr/local/nginx/etc/nginx.conf /etc/nginx

vi /etc/nginx/nginx.conf

and add following directives

set_real_ip_from   xx.xx.xx.xx;

real_ip_header     XSLRP-Real-IP;

to start nginx use this command nginx -c /etc/nginx/nginx.conf

* replace xx.xx.xx.xx with your reverse proxy IP.

* this is just an idea on how to compile nginx I know there is a better to configure nginx feel free to discuss that with our support staff.

 



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution