Deployment environment:
System : windows 7
Software : nginx-1.9.0 , MySQL-Front , MySQL 5.7
First step : Download and install the Nginx server software.
1.Download url : http://nginx.org/en/download.html (Version 1.9 and above)
2.Unzip the download nginx files to the install folder and rename folder to “nginx”
Second Stop: Start and test the Nginx.
1.edit the nginx -> conf -> nginx.conf file (Optional step )
Change the listen port ( default is 80 ):
2.enter the nginx ,double click the nginx.exe or start in the command line. (Must Step)
Command line method:
Open the task manager -> Processes ( must )
Test in browser:
Third step : Add the TCP proxy module in nginx.conf and testing.
1.add the stream module to nginx.conf (end of the text )
stream {
upstream cloudsocket {
hash $remote_addr consistent;
server 127.0.0.1:3306 weight=5 max_fails=3 fail_timeout=30s;}
server {
listen 2014;
proxy_connect_timeout 30s;
proxy_timeout 600s;
proxy_pass cloudsocket;
}
}
2.reload the conf through command line.
3.Test in other competer to connect mysql Database through port 2014.
Using the MySQL-Front connect :
If the connection successful and allow to operate the database, signify the nginx has been set up successfully.
Ps:the mysql account is test data,must use real accounts when you deploy.
Ps:自己写的Guide Line,英文太差,有错欢迎指出,指出必改,非常感谢。