IIS under Windows Server, Nginx Proxy payload

Source: Internet
Author: User

Before using. NET to do the site, are using IIS, should now be used for some needs to use the Nginx use, not much to say, come true!

One, nginx related configuration Baidu Bar online a lot.

Demo

1 Upstream web_www{2Server127.0.0.1:5006;3Server192.168.1.1:5006; # You can configure the weight access method4 #可以更多个5     }6 server {7Listen the;8 server_name xxx.domain.com; #域名9 Ten #如果是防止爬虫抓取的使用 One          if($http _user_agent ~*"qihoobot| baiduspider| Googlebot| googlebot-mobile| googlebot-image| mediapartners-google| adsbot-google| Feedfetcher-google|yahoo! slurp|yahoo! slurp china| Youdaobot| sosospider| Sogou spider| Sogou Web spider| msnbot|ia_archiver| Tomato Bot")  A         {  -         return 403;  -         }  the  -Location/ {  -Proxy_set_header x-real-IP $remote _addr; -Proxy_set_header x-forwarded-For $proxy _add_x_forwarded_for; + proxy_set_header Host $http _host; -Proxy_set_header X-nginx-proxytrue; +Proxy_pass http://web_www; A                     at proxy_redirect off; - client_max_body_size 20m;  -         } - root html;  - index index.aspx;  -       in          -Error_page - 502 503 504/50x.html; toLocation =/50x.html { + root html; -         }  the       *}
View Code

  

  

Second, Nginx startup is unsuccessful:

If the server has IIS installed, want to use nginx may encounter a variety of pits, a variety of 80 occupied Nginx boot is not successful, pay attention to see Nginx logs error message

A configuration error may have caused the boot to be unsuccessful.

For example: If it is the first line of error, the general first line is commented out of no problem, it should be included in the BOM format encoding

If bind () to 0.0.0.0:80 failed (10013:an attempt is made to access a socket in a-to-do forbidden by its access Permissi ONS) That's basically the 80-port footprint.

The workaround is a. Telnet 127.0.0.1 80 Then enter should be prompted

1 If IIS is occupied there would be such a kind of http/1.1. Request content-type:text/html; Charset=us-ascii server:microsoft-httpapi/2.0 and the like IIIs try .

2 If still not stop service IIS Admin try

B. Netstat-aon | findstr "80" in tasklist found that there is an ID of 4 that is the system This process is resolved by:  

1 if you have SQL database installed to deactivate Reporting Services,

2 If still not open registry run input regedit find Hkey_local_machine\system\currentcontrolset\services\http Modify entry start will 3 instead of 0

This is basically the solution, and the solution sequence is based on the situation.

                  

        

  

IIS under Windows Server, Nginx Proxy payload

Related Article

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.