title: nginx forward and rewrite url
body: <p>I run a simple wordpress website on <code>localhost:8888/website</code> with MAMP.
  I want nginx to forward all traffic on <code>localhost:80</code>to <code>localhost:8888/website</code></p>
  
  <p>My nginx.conf file looks like this:</p>
  
  <pre><code>http {
    map $http_upgrade $connection_upgrade{
    default upgrade;
    '' close;
    }
  
   server {
    listen 80;
  
    location / {
      rewrite / /website break;
      proxy_pass http://localhost:8888/;
        proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
  }
  </code></pre>
  
  <p>}
  }</p>
  
  <p>This leads to <code>localhost/website/</code> but I want to forward to localhost:8888/website.</p>
  
  <p>How come I'm not being forwarded to the right port and how can I correct this?</p>