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

【Double 11】Micro-based host: a late Double 11 event

Part 1: Top-up Offers WIKIHOST recharge balance e...

DirectSpace: $5/month/2CPU/1GB memory/40GB SSD/unlimited traffic/1 IP/KVM

DirectSpace is a long-established American hostin...

HostDare 4GB RAM Los Angeles KVM VPS Review

Details: HostDare: $19/year/768MB memory/17GB spa...

WootHosting: $9.95/year/512MB RAM/20GB storage/1TB bandwidth/OpenVZ/Los Angeles

WootHosting, an American hosting provider, was fo...