title: What's a simple way to serve http://localhost as https://someOtherDomain?
body: <p>I run a local development web server for testing out code changes.</p>
  
  <p>Often I have to test my local changes with remote services that can only connect securely to another domain. </p>
  
  <p>e.g. <code>https://external1.com</code> will only talk to <code>https://someOtherDomain.com</code>, but I've got to test integration of my new code changes with <code>https://external1.com</code></p>
  
  <p>While I've got a setup configured that works, it seems complex, and took a bit to get setup right. It seems to me that many developers would want to do this same thing, so my question is this:</p>
  
  <p><strong>Is there an easy way to proxy my local webserver as <a href="https://someOtherDomain.com" rel="noreferrer">https://someOtherDomain.com</a> ?</strong></p>
  
  <h3>EDIT: So maybe this should be asked this way - Does a command line or GUI tool exist that you can pass a local port and a domain name, and it serves your local port securely over <a href="https://someOtherDomain.com" rel="noreferrer">https://someOtherDomain.com</a> - no config or SSL cert creation required? Of course it'd be nice if the SSL cert could be replaced through configuration if need be, but by default, it'd work automatically, by using a precanned SSL cert. And even though I'm using Apache, I'm looking for a solution that actually <em>doesnt</em> use Apache - it uses something else. Why? Because I want this solution to work well with any other webserver that's being used by people on our team - as we all run different stacks, and I'd like to be able to let any of us securely serve our sites without having to configure each webserver individually.</h3>
  
  <p>Here's my current setup for taking my local webserver and serving it up at <code>https://www.someOtherDomain.com</code></p>
  
  <p>To test this locally, I've been:</p>
  
  <ul>
  <li><p>editing my hosts file, and adding an entry to make www.someOtherDomain.com point to my local machine, which of course is running my dev server. This makes it so my local site is now available at <code>http://www.someOtherDomain.com</code></p>
  
  <p><code>127.0.0.1 www.someOtherDomain.com</code></p></li>
  <li><p>Running Apache with a SSL Cert setup and mod_proxy to redirect all https requests to my local http server, thus making my site available at <code>https://www.someOtherDomain.com</code>. Here's my Apache config for this:</p>
  
  <pre><code>ServerName www.someOtherDomain.com
  
  &lt;Location /balancer-manager&gt;
     SetHandler balancer-manager
  &lt;/Location&gt;
  
  ProxyPass /balancer-manager !
  ProxyPass / balancer://mycluster/ 
  
  &lt;Proxy balancer://mycluster&gt;
    BalancerMember http://localhost route=1
  &lt;/Proxy&gt;
  ProxyPass / balancer://mycluster
  ProxyPassReverse / balancer://mycluster
  
  SSLHonorCipherOrder On
  SSLProtocol -ALL +SSLv3 +TLSv1
  SSLCipherSuite RC4-SHA:HIGH:!ADH
  
  # Rewrite all http requests to https
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  </code></pre></li>
  </ul>
  
  <p>I run this on a mac, but am interested in solutions for linux as well. I've seen various Man in the Middle proxy's that sound like they'd work with some configuration... but I'm looking for something really simple to install and run - not just for me, but something I can tell team members about too, as we may all have to do this a lot in the future.</p>
  
  <p>IMPORTANT NOTE: My local webserver isn't running on Port 80, though I've put it this way in the above example, to keep it simple. I understand port 80 on a mac is a bit special, but am very happy with solutions that work fine on all ports <em>but</em> port 80.</p>