Nginx reverse generation settings under Centos 6

Nginx reverse generation settings under Centos 6

Host requirements : 64MB of memory, port 80 is not occupied

1. Upgrade the system and uninstall Apache

 Yum update -y Yum remove httpd -y

2. Change the update source
a. Use EPEL repo
b. Update source

 rpm -Uvh http://mirror.ancl.hawaii.edu/linux/epel/6/i386/epel-release-6-8.noarch.rpm

3. Install Nginx and set up
a. Install Nginx

 yum install nginx -y

b. Adjust Nginx configuration

 cd /etc/nginx/conf.d mv default.conf default.conf.disabled

4. Create an Nginx anti-generation configuration file (replace zzsba.com with your own domain name below)

 cd /etc/nginx/conf.d vi zzsba.com

Paste the following:

 server { listen 80; server_name zzsba.com; access_log off; error_log off; location / { proxy_pass http://需要反代的服務器IP/; 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; proxy_max_temp_file_size 0; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } }

Then save it.

5. Set up a firewall to allow access to port 80

 iptables -I INPUT 5 -m state --state NEW -p tcp --dport 80 -j ACCEPT service iptables save service iptables restart

6. Start Nginx

 service nginx start

via: https://www.lowendtalk.com/discussion/31261/nginx-reverse-proxy-tutorial-centos-6

<<:  BandwagonHost: $2.88/month/512MB RAM/10GB SSD space/500GB bandwidth/KVM/Los Angeles

>>:  TNAHosting: $5/month/2GB RAM/100GB storage/1TB bandwidth/KVM/Chicago

Recommend

3proxy 0.711 modified version

1. Modify the last sentence username password you...

Crissic: $13/year/512MB RAM/100GB hard drive/2TB bandwidth/OpenVZ

Crissic is a formal company that has been introdu...

cPanel panel host scheduled backup and upload to the remote FTP server

It is very important to back up the website every...

Node Wing: $39/year/1GB memory/60GB space/unlimited traffic/KVM/France

Node Wing, a foreign hosting company, was establi...

HostHatch 1GB RAM 1.5TB Space Los Angeles KVM VPS Review

Details: HostHatch: $60/year/1GB memory/1.5TB spa...

Hotspot LTMP v1.3.0 (Tengine+mysql+php)

Hotspot LTMP is a one-click installation program ...