IIS Tomcat shares port 80 and port iistomcat80

Source: Internet
Author: User
Tags nginx reverse proxy

IIS Tomcat shares port 80 and port iistomcat80

Why is there such a demand,

The reason is,

The company has A Java web project. On another server A, the boss has recently emerged and wants to merge it into server B of this stable point, server B uses IIS to host the asp.net website,

What should we do? Stick to your head and find various solutions on the Internet:

  • Solution 1: isapi_redirect

I tried this method N times, but I did not solve it,

  • Solution 2: IIS reverse proxy

The basic logic is that the request comes to IIS. IIS forwards the request to Tomcat Based on the routing rules, and then tomcat returns the response to IIS,

This solution still exclusive IIS port 80, it seems that it is IIS Tomcat sharing port 80

The following https://www.microsoft.com/web/handlers/webpi.ashx/getinstaller/ARRv3_0.appids needs to install an IIS plug-in:

The configuration files generated after various configurations on the iis ui are as follows:

<?xml version="1.0" encoding="UTF-8"?><configuration>    <system.webServer>        <rewrite>            <rules>                <rule name="tomcat">                    <match url="^(.*)" />                    <conditions>                        <add input="{HTTP_HOST}" pattern="^www.ahapc.org$" />                    </conditions>                    <action type="Rewrite" url="http://localhost:8080/{R:1}" />                </rule>            </rules>        </rewrite>    </system.webServer></configuration>

^ (. *) Indicates that the regular expression matches all requests,

Www.ahapc.org indicates that the input matches, that is, if your request contains www.ahapc.org, the forwarding conditions are met.

Http: // localhost: 8080/{R: 1} indicates that the above conditions are met and then forwarded to the local 8080 for processing, that is, to the local Tomcat for processing.

  • Solution 3: nginx reverse proxy

 

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.