Eg:nginx reverse proxy Two Web servers for load balancing all Web services share a single NFS storage

Source: Internet
Author: User
Tags nginx reverse proxy

Step1: Three Web Server Environment configuration: iptables-f; Setenforce 0 shut down the firewall; close Setlinux

Step2: Three Web server install software

STEP3: Host modification configuration file: vim/usr/local/nginx/conf/nginx.conf

Proxy Server Modify the file: Modify the port, the port can be set by itself, do not change the default is OK, but the corresponding match

For test needs, change the HTML files for the three Nginx machines:

Mv/usr/local/nginx/html/index.html/usr/local/nginx/html/index.html.bak

echo Server1 (SERVER2/3) >> mv/usr/local/nginx/html/index.html

Step4: Start Ngnix

/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

STEP5 test the IP of the access host to see if the server will be replaced.

STEP6 Three Machines install NFS (the above environment is already configured OK)

Yum Install Rpcbind nfs-utils-y

STEP7 Host Configuration NFS

Mkdir/share #创建分享目录

Mount/dev/sdb1/share mount a usable hard disk

Vim/etc/exports

To start NFS:

Modify the path permissions of the/share to allow access to read and write permissions for the client

chmod 775/share

STEP8 Modifying the proxy server:

Proxy Server as Client, NFS configuration is not modified, but shared files must be set

Mount 192.168.16.183:/share/usr/local/nginx/html (Set the shared file path to HTML to ensure that three machines share the same storage)

STEP9 Test

echo ' Hello World ' >>/share/test.html

Access IP to see if it can be displayed

Eg:nginx reverse proxy Two Web servers for load balancing all Web services share a single NFS storage

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.