:: how to installing nginx on linux debian
|
1 |
# aptitude install nginx |
:: configure nginx as reverse proxy
+ create reverse proxy setup file
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# cd /etc/nginx/conf.d
# vi proxy.conf
#### reverse proxy setup for nginx
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k; |
+ setup proxy_pass on vhost / nginx.conf
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# vi blackonsole.com.conf
server {
listen 80;
server_name blackonsole.com www.blackonsole.com;
access_log /var/log/nginx/blackonsole.com.access.log ;
error_log /var/log/nginx/blackonsole.com.error.log ;
location / {
proxy_pass http://10.100.100.80:8080/ ;
include /etc/nginx/conf.d/proxy.conf;
}
} |
:: testing and restarting nginx
|
1 2 |
# nginx -t
# /etc/init.d/nginx restart |
:: installing apache and rpaf module
|
1 |
# aptitude install apache2 libapache2-mod-rpaf |
:: configure apache to use nginx proxy
+ change port
|
1 2 3 |
# vi /etc/apache2/ports.conf
NameVirtualHost *:8080
Listen 8080 |
+ enable rpaf-module on apache
|
1 2 3 4 5 6 7 |
# vi /etc/apache2/sites-enabled/000-default
<VirtualHost *:8080>
### add these line in VirtualHost configuration
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 10.100.100.80 ### can use multiple IP address
</VirtualHost> |
:: starting apached
|
1 |
# /etc/init.d/apache2 start |
:: checking open port for nginx and apache
|
1 2 3 4 |
# netstat -tlpn | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 16548/nginx
tcp6 0 0 :::8080 :::* LISTEN 17347/apache2
tcp6 0 0 :::80 :::* LISTEN 16548/nginx |
:: testing
open your host / domainame using web browser.
|
1 |
http://blackonsole.com |
wew…. sangar dab…
biasa mawon mas..
mas…
iku mari install rpaf, kiro2 nek httpd.conf butuh load module po ra?
LoadModule rpaf_module /usr/lib64/httpd/modules/mod_rpaf-2.0.so
ne’ di install dari repo biasa.ne wez otomatis..
Excellent Post on proxy server associated anonymous email. I actually am into the proxy server business too.
john