Configure nginx to support php, jsp, asp, and aspx

Source: Internet
Author: User
Tags nginx reverse proxy
When it comes to Nginx, you should be familiar with it. although it was a little late, its excellent performance caused many system engineers to fold and be widely used. There are many articles on the Internet that show you how to enable nginx to support jsp, asp, and so on. I would like to say this is not correct, because nginx itself is only a static server and

When it comes to Nginx, you should be familiar with it. although it was a little late, its excellent performance caused many system engineers to fold and be widely used. There are many articles on the Internet that show you how to enable nginx to support jsp, asp, and so on. I would like to say that this is not correct, because nginx itself is only a powerful tool for static server and reverse proxy, and does not support dynamic pages. The so-called support for asp, jsp, php and so on are just using nginx for reverse proxy.

We have already introduced nginx's support for php through fastcgi. here we will only introduce how to use nginx Reverse proxy tomcat and other jsp containers to serve jsp pages:

Suppose you have configured tomcat and run it on port 8080 of the local machine. open your VM configuration file and add the following lines:
Location /{
Proxy_pass http: // 127.0.0.1: 8080;
Proxy_redirect off;
Proxy_set_header Host $ host;
Proxy_set_header X-Real-IP $ remote_addr;
Proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for;
Client_max_body_size 10 m;
Client_body_buffer_size 128 k;
Proxy_connect_timeout 30;
Proxy_send_timeout 30;
Proxy_read_timeout 30;
Proxy_buffer_size 4 k;
Proxy_buffers 4 32 k;
Proxy_busy_buffers_size 64 k;
Proxy_temp_file_write_size 64 k;
}

OK. jsp can run! Want to radial proxy IIS? Apache? -- Do it!

PS: now the official version of Nginx for Windows has been released. Therefore, the support for Asp or. net is just a matter of course. you can do it directly on one machine without relying entirely on mono.

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.