title: proxy_set_header Hodst $host necessary for admin panel urls but messes up other wordpress urls
body: <h1>When I put</h1>
  
  <pre><code>proxy_set_header Host $host;
  </code></pre>
  
  <p>under location /wordpress/ in my nginx.conf-file, I get working Wordpress urls apart from the admin panel where /wordpress/ is removed from the urls, making all links in the admin panel non-functional.</p>
  
  <p>If I remove proxy_set_header Host $host;, I get non-working Wordpress urls but a working admin-panel.</p>
  
  <p>I run a Wordpress install with a NextJs front-end with docker-compose and an nginx reverse proxy in front of it. I need both working Wordpress urls and the admin panel because I need access to the RSS feed (the /feed-url which doesn't work when I do the proxy_set_header-thing).</p>
  
  <h2>My location-block in nginx-conf:</h2>
  
  <pre><code> location /wordpress/ {
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-NginX-Proxy true;
          proxy_pass http://IP-TO-WORDPRESS:8000/;
          # proxy_set_header Host $host;
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-Proto $scheme;
      }
  </code></pre>
  
  <h2>Tried</h2>
  
  <ul>
  <li>adding and removing proxy_set_header Host $host,</li>
  <li>adding a special location block for wp-admin (/wordpress/wp-admin - didn't work)</li>
  <li>changing the url of proxy_pass</li>
  <li>changing siteurl and home in wp_options in the wordpress mysql database</li>
  </ul>
  
  <h2>Entire Nginx.conf:</h2>
  
  <pre><code>events {
      worker_connections  1024;
      # worker_processes and worker_connections allows you to 
      calculate maxclients value:
      # max_clients = worker_processes * worker_connections
  }
  
  http{
      server {
          listen 80;
          listen [::]:80 default_server ipv6only=on;
          return 301 https://$host$request_uri;
      }
  
      # HTTPS ?~@~T proxy all requests to the Node app
      server {
          # Enable HTTP/2
          listen 443 ssl http2;
          listen [::]:443 ssl http2;
          server_name SERVER-NAME.no;
  
          # Use the Let?~@~Ys Encrypt certificates
          ssl_certificate /etc/letsencrypt/live/SERVER- 
          NAME.no/fullchain.pem;
          ssl_certificate_key /etc/letsencrypt/live/SERVER- 
          NAME.no/privkey.pem;
  
          # Include the SSL configuration from cipherli.st
          include snippets/ssl-params.conf;
  
          location / {
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For 
              $proxy_add_x_forwarded_for;
              proxy_set_header X-NginX-Proxy true;
              proxy_pass http://localhost:82/;
              proxy_ssl_session_reuse off;
              proxy_set_header Host $http_host;
              proxy_cache_bypass $http_upgrade;
              proxy_redirect off;
          }
  
          location = /wordpress {
              return https://SERVER-NAME.no/NEXT-JS-BLOG-PAGE;
          }
  
          location /wordpress/ {
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For 
              $proxy_add_x_forwarded_for;
              proxy_set_header X-NginX-Proxy true;
              proxy_pass http://IP.TO-WORDPRESS:8000/;
              # proxy_set_header Host $host;
              proxy_set_header X-Forwarded-Host $host;
              proxy_set_header X-Forwarded-Server $host;
              proxy_set_header X-Forwarded-Proto $scheme;
          }
      }
  }
  </code></pre>
  
  <h2>Expected:</h2>
  
  <p>I would expect urls to work both in the wordpress admin panel and for the wordpress posts and rss feed. This is not the case.</p>
  
  <p>Please help as I'm quite lost on this one.</p>