Domain + subdomain IIS deployment

PHPz
Release: 2024-02-09 21:50:09
forward
732 people have browsed it

Domain + subdomain IIS deployment

php editor Strawberry introduces domain subdomain IIS deployment to you, which is a method of configuring multiple domain names and subdomain names on the IIS server. Through flexible configuration of domain names and sub-domain names, multiple websites can be run on the same server, improving server utilization. During the deployment process, IIS needs to be set up and configured accordingly to ensure that each domain name and subdomain name can be accessed normally. This deployment method not only facilitates the management and maintenance of multiple websites, but also improves user experience and website usability.

Question content

I have two websites. The first is asp.net core web ui. Followed by golang api. I also bought a domain name. foo.bar (for example). I need two websites:

  1. foo.bar - asp.net user interface
  2. api.foo.bar - go api

How to deploy it on iis? My go-server works on port 8080. I try to create two sites:

  1. Host name is empty
  2. Hostname: api.foo.bar

And foo.bar (ui) works

I also tried using iis rules to redirect api-traffic to port 8080 but it didn't work. For api.foo.bar I only get error 404. The only result I get is that api.foo.bar:8080 is opened correctly from the server's browser.

Solution

I created two websites:

  1. foo.bar (for asp.net ui), hostname is empty;
  2. Hostname: api.foo.bar for api.

Then I put the rewrite rules into api-site's web.config:

<rewrite>
    <rules>
      <remove name="ReverseProxyInboundRule1" />
      <rule name="ReverseProxyInboundRule1" patternSyntax="Wildcard" stopProcessing="true">
          <match url="*" />
          <action type="Rewrite" url="http://localhost:8080/{R:0}" />
      </rule>
    </rules>
</rewrite>
Copy after login

everything is normal

The above is the detailed content of Domain + subdomain IIS deployment. For more information, please follow other related articles on the PHP Chinese website!

source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!