localhostのみで動作する「編集と継続」機能を使用している間に、私は実際のドメインを使用したいので、dev環境でプロキシを使用しています。プロキシ経由でクッキーを設定する
カスタムホストでローカルマシンにwww.site.com
を設定しました。 (シンプルなHTMLページ)
私はこのアプリを持っています:localhost:9090
これは私のローカルPCの私のasp.net mvcアプリケーションです。 www.site.com
ajax経由でlocalhost:9090
に電話をかけますが、localhostはドメイン「.site.com」のCookieを作成できません。
私はwidgets.site.com
を作成してカスタムホストを逆プロキシとしてlocalhost:9090
に設定していますので、編集と継続機能を使用してください。
ローカルホストがワイルドカードドメイン「.site.com」にCookieを設定するにはどうすればよいですか?
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost:9090/{R:1}" />
<conditions>
<add input="{HTTP_COOKIE}" pattern="(.*)" />
</conditions>
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="" />
<set name="HTTP_COOKIE" value="{c:1}" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://widgets.site.com/(.*)" />
<action type="Rewrite" value="http{R:1}://localhost/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
私はホスト: '127.0.0.1 widgets.site.com'を実行すると、外部ホストを使用するようにプロジェクト設定を構成する必要があります。編集と継続機能が失われてしまいます。質問)。 – SexyMF