Implementation of Nginx Domain name forwarding
Nginx introduction
Nginx ("engine x") is a high-performance Web and reverse proxy server developed by Russian programmer Igor Sysoev. It is also an IMAP/POP3/SMTP proxy server. In the case of high connection concurrency, Nginx is a good alternative to Apache servers.
Nginx installation
1. Install compilation tools and library files
Yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
two。 Install PCRE
Download and extract the source package cd installation directory by yourself. / configure make & & make install// compilation and installation
3. Install Nginx
Download and extract the source package cd installation directory by yourself. / configuremakemake install
Nginx common commands
# under the nginx/sbin directory # start nginx./nginx## and close nginx./nginx-s stop## to reload the configuration file. / nginx-s reload
Domain name forwarding configuration
The following is my configuration file, I only configured a simple domain name forwarding function, did not use other nginx features, nginx is extremely powerful, domain name forwarding is just the tip of the iceberg.
# # nginx/conf/nginx.confworker_processes 1 listen events {worker_connections 1024;} http {include mime.types; default_type application/octet-stream; sendfile on; server {listen 80; server_name www.fbm.com; location / {root html; index index.html index.htm; proxy_pass http://localhost:8080;}} server {listen 80; server_name fmp.hzfh.com Location / {proxy_pass http://fmp.hzfh.com;}
Note: don't forget to open the port on the firewall.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.