A: Introduction
Nginx is a lightweight Web server/reverse proxy server and e-mail (IMAP/POP3) proxy server that is released under a bsd-like protocol. Developed by Russian program designer Igor Sysoev for use in Russian large portals and search engine Rambler (Russian: Рамблер). It is characterized by the possession of less memory, concurrency is strong, in fact, nginx concurrency is actually in the same type of Web server performance better.
Second: This installation is a reverse proxy server running on Windows, which is used primarily with IIS
Directly start the EXE file can be
Note: Folders cannot contain Chinese, otherwise there will be errors
Three: Create 2 tested files, published on IIS
Four: Modify the nginx.conf file
#user nobody;worker_processes1; #error_log logs/Error.log, #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections1024x768;} HTTP {include mime.types; Default_type Application/octet-stream; #log_format Main'$remote _addr-$remote _user [$time _local] "$request"' # '$status $body _bytes_sent "$http _referer"' # '"$http _user_agent" "$http _x_forwarded_for "'; #access_log logs/Access.log Main; Sendfile on; #tcp_nopush on; #keepalive_timeout0; Keepalive_timeout $; #gzip on; upstream www.aaa.com {server 127.0.0.1:8081 weight=1; #第一个测试网站 server 127.0.0.1:8082 weight=1; #第二个测试网站} Server { Listen 8080 ; #这个原来是80端口, if 80 has been occupied need to be modified server_name localhost; #charset Koi8-R; #access_log logs/Host.access.log Main; Location/{root HTML; Index index.html index.htm; proxy_pass http: //www.aaa.com; #反向代理指向地址} #error_page404/404. html; # REDIRECT Server error pages to theStaticPage/50x.html # Error_page - 502 503 504/50x.html; Location= /50x.html {root html; } # Proxy The PHP scripts to Apache listening on127.0.0.1: the# #location~\.php$ {# Proxy_pass http://127.0.0.1;#} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000# #location~\.php$ {# root HTML; # Fastcgi_pass127.0.0.1:9000; # Fastcgi_index index.php; # Fastcgi_param Script_filename/Scripts$fastcgi_script_name; # include Fastcgi_params; #} # Deny access to. htaccess files,ifApache's Document Root# concurs with Nginx'S One# #location~ /\.ht {# deny all; #}} # anotherVirtualHostusingMix of ip-, name-, and port-based configuration # #server {# listen8000; # Listen Somename:8080; # server_name somename alias Another.alias; # Location/{# root HTML; # index index.html index.htm; #} #} # HTTPS Server # #server {# listen443SSL; # server_name localhost; # ssl_certificate Cert.pem; # Ssl_certificate_key Cert.key; # Ssl_session_cache shared:ssl:1m; # ssl_session_timeout 5m; # Ssl_ciphers High:!anull:!MD5; # ssl_prefer_server_ciphers on; # Location/{# root HTML; # index index.html index.htm; # } #}}
Then start directly, but you need to pay attention to the space in the above content, or start failure
Nginx +iis Reverse Proxy