Programming

IISExpress는 원격 컴퓨터에서 503 오류를 반환합니다

procodes 2020. 5. 19. 20:35
반응형

IISExpress는 원격 컴퓨터에서 503 오류를 반환합니다


로컬 네트워크의 다른 컴퓨터 / 장치와 함께 로컬 IISExpress 인스턴스에서 실행중인 웹 사이트를 테스트하려고합니다. Win7 Pro를 실행하고 있습니다.

로컬 네트워크 세그먼트의 다른 컴퓨터에서 내 컴퓨터를 탐색하려고하면 400 오류가 발생합니다. 호스트 이름이 잘못되었습니다.

다음과 같이 관리자 권한 명령 프롬프트에서 명령을 사용하여 ACL에 대한 원격 액세스 권한을 부여해야한다는 것을 이해합니다.

netsh http add urlacl url=http://mymachinename:50333/ user=everyone

이제 503 서비스를 사용할 수 없습니다 오류가 발생합니다.

Windows 방화벽이 현재 종료되었으며 주소로 로컬 IISExpress 인스턴스를 찾아 볼 수 있습니다. http://localhost:50333

이 구성 퍼즐의 마지막 부분은 무엇입니까?


applicationhost.config 파일에 바인딩 정보 항목이없는 것 같습니다.

  1. applicationhost.config 파일을여십시오. 가능한 위치는 다음과 같습니다.

    • %userprofile%\Documents\IISExpress\config\applicationhost.config
    • $(solutionDir)\.vs\config\applicationhost.config (VS2015)
    • 실패하면 출력을 검사하여 iisexpress.exe확인하십시오.
  2. WebSite 항목을 찾아 시스템 이름으로 다음 바인딩을 추가 하십시오.

         <binding protocol="http" bindingInformation=":50333:your-machine-name" />
    
  3. IIS Express를 다시 시작하십시오.


나를 위해 일한 것은 단 하나였습니다.

사용 *:portnumber:*은 좋지 않았다. 예, 그렇게하고 Windows 방화벽이 열려 있는지 확인한 후에 포트에 연결할 수 있지만 여전히 "503"오류가 발생합니다.

로컬에서 몇 가지를 테스트 한 결과 http : // localhost 만 작동 한다는 것을 알았습니다 . 실제 IP 주소 (127.0.0.1이 아닌 192.168.1.50)를 사용하면 로컬 컴퓨터에서도 여전히 503이 반환됩니다. 바인딩에 실제 호스트 이름을 사용해 보았지만 IIS Express는 시작을 거부했습니다. 실제로 호스트 이름을 확인하는 방법과 관련이있을 수 있습니다. 나는 더 이상 탐구하지 않았다.

마지막 으로이 구성을 사용했습니다.

<binding protocol="http" bindingInformation="*:53351:localhost" />
<binding protocol="http" bindingInformation="192.168.1.50:53351:*" />

그런 식으로을 사용하여 원격 컴퓨터에서 연결할 수있었습니다 http://192.168.1.50:53351.


이러한 전체 주제에 대해 3 시간 이상을 낭비한 후 설정을 공유하기로 결정했습니다. 내 구성은 Windows 8의 웹 업데이트 4에 대한 Visual Express 2012입니다. 이것은 연구 (최소 8 년) 이후 MS VS로 처음 돌아 왔으며 이제는 Linux 규칙이 확실합니다. django 에서이 종류의 설정은 10 분의 문서 검색을 필요로했습니다.

  1. 테스트를 위해 방화벽을 끄십시오

    netsh advfirewall set allprofiles state off
    
  2. 내 경우 로컬 주소는 localIP = 192.168.1.102입니다 (링크에는 숫자가 아닌 도메인을 포함 할 수 없으므로 mylocaldomain.com 대신 아래를 사용하십시오. 스택 오버 플로우 정책 참조). Documents\IISExpress\config\applicationhost.config

    <bindings>
        <binding protocol="http" bindingInformation="*:53351:mylocaldomain.com" />
        <binding protocol="http" bindingInformation="*:53351:localhost" />
    </bindings>
    
  3. ISS Express 시작 서비스에 대한 자동 실행 추가

    <site name="NeuronCharts" id="2" serverAutoStart="true">
    
  4. http 서버에 이상한 규칙을 추가하십시오 (필요한지 여전히 모르겠습니다)

    netsh http add urlacl url=http://mylocaldomain.com:53351/ user=everyone
    
  5. VS IDE가 아닌 IISExpress를 수동으로 실행

  6. ISSExpress가 바인딩을 등록하고 있음을 알 수 있습니다
  7. 작동하면 브라우저를 실행 http://mylocaldomain.com:53351하고 방화벽 규칙을 추가 할 수 있습니다
  8. 방화벽 규칙 추가

    netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=53351 remoteip=any action=allow
    

로컬 네트워크 사용 localsubnet에 액세스하려면 외부에서 서버에 액세스하려면 remoteip을 any로 설정하십시오.

  1. 방화벽 시작

    netsh advfirewall set allprofiles state on
    
  2. 모든 것이 로컬 및 공용 IP에서 작동하는지 다시 확인하십시오.

행운을 빌어 요

라팔


문제는 잘못된 urlacl 매핑과 관련이 있음을 발견했습니다. 이것을 알아 내려면 :

netsh http show urlacl 

http://+:80/바인딩 할 포트 와 같은 것을 찾으십시오 .

그런 다음 사용

netsh http delete url=<the url from the list>

이것은 나를 위해 문제를 해결했습니다.


아무것도 나를 위해 일하지 않았다. 마침내 나는 iisexpress-proxy를 찾았다.

내 대답을 참조하십시오 https://stackoverflow.com/a/33623399/631527

또 다른 해결책은 ngrok


What helped me, was right clicking the 'IISExpress' icon, 'Show All applications'. Then selecting the website and I saw which aplicationhost.config it uses, and the the correction went perfectly.

IISExpress configuration


The problem is updating the applicationhost.config file inside the web folder instead of the solution's. The solution config file is the one to change


Regarding Anthony Rizzolo's answer: in Windows 8.1, I had to type like this:

netsh http delete urlacl url=<the url from the list>

For example:

netsh http delete urlacl url=http://+:8689/

None of the answers above worked for me.

I have had two entries in netsh for the same service

netsh http show urlacl

enter image description here

One using a strong wildcard, the other one using a weak wildcard.

Removing the one with the weak wildcard did the job.

More about the strong and weak wildcard in the context of netsh

When the host element of a UrlPrefix consists of a single plus sign (+), the UrlPrefix matches all possible host names in the context of its scheme, port and relativeURI elements, and falls into the strong wildcard category.

When an asterisk (*) appears as the host element, then the UrlPrefix falls into the weak wildcard category. This kind of UrlPrefix matches any host name associated with the specified scheme, port and relativeURI that has not already been matched by a strong-wildcard, explicit, or IP-bound weak-wildcard UrlPrefix. This host specification can be used as a default catch-all in some circumstances, or can be used to specify a large section of URL namespace without having to use many UrlPrefixes.

https://docs.microsoft.com/en-gb/windows/desktop/Http/urlprefix-strings


After solution of @vikomall don't forget to start VS as adminisrator. This fix it for me.

참고URL : https://stackoverflow.com/questions/5442551/iisexpress-returns-a-503-error-from-remote-machines

반응형