Forward requests to new server

zabulus

New member
Joined
Feb 5, 2006
Messages
4
Hi,

So I have setup my new Debian 4.0 server in a new DC.
DirectAdmin is installed, works perfectly.

I'm now doing the server to server transfer (Admin Backup/Transfer), also no problems here...

Now the question is, how to I forward the requests from my old server to my new one... Because the DNS isn't directly updated...
I don't know if this could be done through DA...

Grtz, zabulus
 
You can try installing nginx as a reverse proxy to the new server.
1) Install RPAF to the new server, select your old server's ips as RPAFips
2) Fetch and install nginx.
3) In nginx configuration, write:
Code:
user  nobody nobody;
worker_processes 2;
events {worker_connections 4096;}

http {
 include conf/mime.types;
 default_type application/octet-stream;
 sendfile on;
 tcp_nopush on;
 tcp_nodelay on;
 client_header_timeout 3m;
 client_body_timeout 3m;
 send_timeout 3m;
 client_header_buffer_size 4k;
 large_client_header_buffers 4 4k;
 gzip on;
 gzip_min_length 1024;
 gzip_buffers 12 32k;
 gzip_types text/html application/x-javascript application/xml text/css;
 output_buffers 4 32k;
 postpone_output 1460;
 keepalive_timeout 75;
 limit_zone one $binary_remote_addr  10m;
Then, for every old and new ip:
Code:
server {
listen oldip;
access_log off;
location / 
{
proxy_pass http://newip:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffer_size 4k;
proxy_buffers 120 64k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
And don't forget about closing config with "}".
 
I'd suggest to modify DNS. You'll need to change IPs in your DNS configuration to the new server ones.
 
Back
Top