title: How to reverse proxy the header or url content for nginx?
body: <p>I have to bellow systems:
  nginx version: nginx/1.19.9 and lua module</p>
  <p>I wrote to special header content the serveraddress: 192.1.1.1 and i make a url the <a href="http://myngnixserver.com/serveraddress=http://192.1.1.1" rel="nofollow noreferrer">http://myngnixserver.com/serveraddress=http://192.1.1.1</a></p>
  <p>I want to reverse proxy this content. Header or url. I'am researching all day but i don't make successfully.</p>
  <p>Request: <a href="http://myngnixserver.com/serveraddress=http://192.1.1.1" rel="nofollow noreferrer">http://myngnixserver.com/serveraddress=http://192.1.1.1</a> (I will sent the diffirent url for my php form. So I have to forward every incoming request. This raises some security concerns for me. Therefore, it will be much better if I can direct it to the ip address that comes with the header. )
  proxy_pass: <a href="http://192.1.1.1" rel="nofollow noreferrer">http://192.1.1.1</a></p>
  <p>Header content: serveraddress: 192.1.1.1
  proxy_pass: <a href="http://192.1.1.1" rel="nofollow noreferrer">http://192.1.1.1</a> (I take it in header content the serveraddress) and i want to make the reverse proxy.</p>
  <p>Example my nginx conf:</p>
  <pre><code>location ^~ /{
  if ($args ~* (.*)(serveraddress=http%3A)(.*)) {
      set $args $1serveraddress=https%3A$3;
      rewrite ^.*$ $1 redirect;
  }
  
  proxy_pass http://127.0.0.1:80$uri$is_args$args;
  proxy_redirect http:// https://;
  }
  </code></pre>
  <p>How can i do? I hope for yours help.
  Thank you.</p>