title: Make request to local server on port 8080
body: <p>I have now the following flow.</p>
  
  <pre><code>example.com =&gt; https://example-example.mycompany.com =&gt; myproxy =&gt; someServer
  </code></pre>
  
  <p>I am right now developing <code>myproxy</code> and it changes the answers that the clients of the website <code>example.com</code> are receiving.</p>
  
  <p>In order to test this, I thought that the best idea I could come up with was changing my local machine (in which I have an instance of <code>myproxy</code> running on the port <code>8080</code>) so I redirect only my requests that go to <code>example-example.mycompany.com</code> to <code>localhost:8080</code></p>
  
  <p>I have tried with <code>nginx</code> adding the following configurationbut I was unable... and also changing <code>/etc/hosts</code> didn't help me.</p>
  
  <h3>Question</h3>
  
  <p><strong>Is there any way to change the call of <code>example-example.mycompany.com</code> <em>JUST</em> for my computer, so that while I am testing there is no client of <code>example.com</code> affected by the changes in the local <code>myproxy</code>?</strong></p>
  
  <h3>Trials</h3>
  
  <ul>
  <li>Create a docker container running in 8080 and 80 and try to make the requests against it</li>
  </ul>
  
  <p><code>docker run --name my-custom-nginx-container -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro -p 80:80 -p 3000:8080 --rm -d nginx</code></p>
  
  <ul>
  <li>Creating an nginx server (so I don't have issues with containers maybe not being properly bind)</li>
  </ul>
  
  <p>nginx.conf</p>
  
  <pre><code>server {
              listen   80;
              server_name example-example.mycompany.com;
  
              location / {
                      proxy_set_header X-Real-IP $remote_addr;
                      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                      proxy_set_header Host $host;
                      proxy_set_header X-NginX-Proxy true;
                      proxy_pass http://localhost:3000/;
                      proxy_redirect http://localhost:3000/ https://$server_name/;
              }
      }
  </code></pre>
  
  <ul>
  <li>Adding the example-example.mycompany.com to the etc/hosts file (didn't do anything)</li>
  </ul>
  
  <p><code>/etc/hosts</code></p>
  
  <p><code>127.0.0.1    example-example.mycompany.com</code></p>
  
  <p><strong>NOTE:</strong> I've seen it work in the computer of my coworker which is using windows. I can't get it to work in Linux/MacOs.</p>