CentOS uses Nginx for reverse proxy

Source: Internet
Author: User
Recently, nginx is used as a reverse proxy in CentOS to solve the interconnection problem between China Telecom and China Netcom. The following is a configuration file for your reference and use. Upstreamlinuxidc_com {ip_hash; server192.168.1.100; // IP address in this region can be set at will} server {listen80 recently used nginx as the reverse proxy in CentOS to solve the interconnection problem between China Telecom and China Netcom, the following is a configuration file for your reference only.

Upstream linuxidc_com {
Ip_hash;
Server 192.168.1.100; // The IP address in this region can be set at will
}


Server {
Listen 80;
Server_name wwwlinuxidc.com; // The domain name in this region can be set at will


# Access_log logs/www.linuxidc.com _ access. log main;
Access_log off;

Location /{
Proxy_pass http://www.linuxidc.com;
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 50 m;
Client_body_buffer_size 256 k;
Proxy_connect_timeout 30;
Proxy_send_timeout 30;
Proxy_read_timeout 60;

Proxy_buffer_size 16 k;
Proxy_buffers 4 32 k;
Proxy_busy_buffers_size 64 k;
Proxy_temp_file_write_size 64 k;
}

# Deny access to. htaccess files, if Apaches document root
# Concurs with nginxs one
#

Location ~ /. Ht {
Deny all;
}
}

In actual use, you may need to configure the IP address and domain name slightly.

------------------------ Split line another article ------------------------

First: rpm-Uvh http://download.Fedora.RedHat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm (the following section of the address has a little change of 32-bit, please select a 32-bit package)
Then you can directly install nginx using yum-y install.

Another nice response proxy server is squid, which can be directly installed in yum-y install squid in centos 5.5.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.