title: How to remove the port number in the url for nginx reverse proxy rule
body: <p>I've two domains(site1.com, site2.com) running on a single server, site1 is running on port 80 of the server itself while site2 running on port 8082 based on a wordpress docker image. The docker is started using the command:</p>
  
  <pre><code>docker run --privileged -itd --name wordpress2 -e WORDPRESS_DB_HOST=mysql -e WORDPRESS_DB_NAME=wp2 -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=pass -p 8082:80 --link mysql:mysql wordpress
  </code></pre>
  
  <p>As site1.com already occupy 80 port and I can't ask user to visit site2.com specifying 8082 port number, so I set nginx proxy_pass rule like below:</p>
  
  <pre><code>server
      {
          listen 80;
          server_name www.site2.com;
  
          location / {
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header REMOTE-HOST $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                  proxy_pass http://127.0.0.1:8082;
          }
      }
  </code></pre>
  
  <p>But it still jump to 8082 port when I enter the url as <a href="http://www.site2.com" rel="nofollow noreferrer">http://www.site2.com</a> in chrome, here is the curl result.</p>
  
  <pre><code>HTTP/1.1 301 Moved Permanently
  Server: nginx
  Date: Sat, 24 Aug 2019 09:29:40 GMT
  Content-Type: text/html; charset=UTF-8
  Content-Length: 0
  Connection: keep-alive
  X-Powered-By: PHP/7.3.7
  Set-Cookie: PHPSESSID=ea2c8aa5c9dfbf79046440cc8f66d35e; path=/
  Expires: Thu, 19 Nov 1981 08:52:00 GMT
  Cache-Control: no-store, no-cache, must-revalidate
  Pragma: no-cache
  X-Redirect-By: WordPress
  Location: http://www.site2.com:8082/
  </code></pre>
  
  <p>could anybody please help to explain what's the reason and how to make it act as normal website?</p>
  
  <p>==========================</p>
  
  <p>solved, just forgot to change wordpress SITEURL and HOME settings, thank RichardSmith again for the kindly help!</p>