나는 다음과 같은 규칙에게 IIS (윈도우 서버 2012)에서 호스팅 내 AngularJS와 응용 프로그램의IIS 재 작성 규칙이 작동하지 않습니다
<rule name="SEO" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_USER_AGENT}" pattern="(facebookexternalhit)|(facebook)|(Twitterbot)|(Pinterest)" />
<add input="{QUERY_STRING}" pattern=".*escaped_fragment_=(.*)" />
</conditions>
<action type="Rewrite" url="http://localhost:8004/{URL}" />
</rule>
있습니다.
내 앱이 html5Mode
$locationProvider.html5Mode().enabled = true;
및 8004
가 열릴 포트를 사용하는 scenrio가 쉽게
(내 시나리오가 작동하는지 확인하는 동안 Windows 방화벽을 해제). 누군가가 facebook
를 통해 내 AngularJS
페이지를 공유하고자하는 경우, 요청은 PhantomJS
가
(페이지를 렌더링하는)에서 수신 대기 whene하여 포트를, 리디렉션됩니다 그러나 문제는 내가 만 주에서 404 오류를 볼 수 있습니다 상자, 어떤 요청이 phantomJS 스크립트에 의해 인출되지 않는다 (즉, 내 추측)
var system = require('system');
var server = require('webserver').create();
server.listen(port, function (request, response) {
console.log(JSON.stringify(request, null, 4));
});
그렇게 작동하지 않는 재 작성 규칙과 같습니다 (I 콘솔 창에 아무것도 표시되지 않습니다). http://localhost:8004/
으로 가면 렌더링 된 페이지와 phantomJS 로그가 콘솔 창에 표시됩니다 (작동합니다)
당신에게 FB 디버그 도구를 사용 했
:2.2) "서버 프록시 설정"을 클릭하고 "프록시 사용"은 다음 규칙에 작은 수정 프로그램을 적용해야합니다 또한
"적용" 캐시를 지우시겠습니까? – CBroe