Set up Proxy Server

ha_saeeda nginx-forum at nginx.us
Sat Sep 19 03:41:21 UTC 2015


Dear, 

I'm trying to set up a proxy server with Nginx. In this case I have two
machines both of them on Linux.

Machine A: is database server e.g => 192.20.2.100
Machine B: is proxy server e.g=> 192.20.4.50

So I want to access to internet via proxy server like this. 
DB=>Proxy=>Internet
I could set up but the Machine A only access to one URL or Site at same
time.
How can I access to any URL at internet from Machine A?

Setting on Machine B:
server {
    listen       192.20.4.50:80;
    server_name  webtest.com
    #charset koi8-r;
    access_log  /var/log/nginx/log/host.access.log  main; 
    location / {
      	root   /usr/share/nginx/html;
       	index  index.html index.htm;

       	client_max_body_size 10m;
client_body_buffer_size 128k;

proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_connect_timeout 30s;
             
#proxy_pass http://127.0.0.1:80;
#proxy_pass http://www.oorsprong.org/;
#proxy_pass http://google.com/;
proxy_pass http://bing.com/;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Best regards,
Saeed.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,261649,261649#msg-261649



More information about the nginx mailing list