title: How to add multiple origins in lua openresty nginx?
body: <p>I have the following in <code>nginx.conf</code>:</p>
  
  <pre><code>header_filter_by_lua_block {
      ngx.header["Access-Control-Allow-Origin"] = "http://example.com"
  }
  </code></pre>
  
  <p>I want to add another <code>http://example.dev</code> to the <code>Access-Control-Allow-Origin</code>. I tried doing <code>http://example.com, http://example.dev</code> but it didn't work.</p>
  
  <p>I also tried doing:</p>
  
  <pre><code>if ($http_origin ~* "^http?://(example.com|example.dev)$") {
      add_header Access-Control-Allow-Origin "$http_origin";
  }
  </code></pre>
  
  <p>But this made some issue in <code>OPTIONS</code> request so I really can't use this. Is there any other way to do inside <code>header_filter_by_lua_block</code>? Please help.</p>