Nginx reverse proxy IIS

Source: Internet
Author: User
Tags nginx reverse proxy


Recently, the Nginx reverse proxy IIS server has been suspended, and IIS has crashed inexplicably. After reading the logs, I found that many exceptions occurred when the application was writing, and the throws were not caught. It is uncomfortable to think that the server is pushed to recovery after a server crash. So I thought of a change. I recently saw a technical post saying that I could use nginx to reverse proxy IIS. I am quite impressed by the lightweight, stable, and flexible nature of nginx. If you don't want to talk about it, just enable it. My general idea is as follows: www.2cto.com domain0 (Linux, nginx) | xen | domain1 (IIS) domain2 ..... domainXdomain0: CETNOS, xen, and nginx (deployment address:/www/nginx/) (static resources, take JPG as an example:/www/nginx/image) domain1... domainx: the website address 192.168.0.x, windows server 2008, and IIS7.0nginx is compiled and installed. All settings are default. Okay, go directly to the configuration file. 1 vim/www/nginx/conf/nginx. conf 2 WWW 2cto.com 3 4 worker_processes 1; 5 events {6 worker_connections 1024; 7} 8 http {9 include safe_block_deny.conf; 10 include mime. types; 11 default_type application/octet-stream; 12 tcp_nodelay on; 13 sendfile on; 14 gzip on; 15 upstream localhost {16 server 192.168.0.29: 80; # domain117 server 192.168.0.33: 80; # domain218} 19 server {20 listen 80; 21 server_name loc Alhost; 22 location/{23 root html; 24 index index.html index.htm; 25} 26 location ~ * \. (Aspx) ${27 proxy_pass http: // localhost; 28 proxy_set_header X-Real-IP $ remote_addr; 29} www.2cto.com 30 location ~ ^/(Image | js | css)/{31 root/www/nginx; 32 expires 24 h; 33} 34 error_page 500 502 503 x.html; 35 location =/50x.html {36 root html; 37} 38} 39} author davyfamer

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.