title: IIS7 Application Request Routing HTTPS
body: <p>I have a reverse proxy that routes traffic to my app server..</p>
  
  <p>I have login feature on my public website that is served through HTTPS. The SSL certificates are installed in the reverse proxy server only. My app server doesn't have SSL certificate. SSL Offloading is enabled in the reverse proxy server.</p>
  
  <p>This works perfectly so far, I can access the login page and the member area via HTTPS. But, I notice that my session cookie is not secure...</p>
  
  <p>I'm using .NET Membership Provider for authentication and this will generate <strong>ASPXAUTH</strong> session cookie as you all know. I tried to enable the httponly and secure flag for this cookie by:</p>
  
  <ol>
  <li>adding requiressl=true for the forms authentication variable in the web.config</li>
  <li>adding httpcookie variable with httponly and requiressl=true.</li>
  </ol>
  
  <p>The first setting always gave me 502 error when I tried to login. 
  <strong>502 - Web server received an invalid response while acting as a gateway or proxy server.</strong> </p>
  
  <p>The second setting gave me the httponly flag but not the secure flag (I disabled the first setting when testing this).</p>
  
  <p>How to solve this..some questions:</p>
  
  <ol>
  <li>Do I need to install SSL in all servers, including my app server?</li>
  <li>Is there any workaround for this?</li>
  </ol>
  
  <p>Please advise.</p>
  
  <p>P.S.</p>
  
  <p>I'm using IIS 7.5 (Reverse Proxy)</p>
  
  <p>Application Request Routing (Reverse Proxy)</p>
  
  <p>IIS UrlRewrite Module (Reverse Proxy)</p>
  
  <p>IIS 8 (app server)</p>