title: How can I use nginx brotli_static with proxy_pass?
body: <p>nginx is compiled with Brotli enabled. In my nginx.conf</p>
  
  <pre><code>http {
      ...
      brotli_static on;
  }
  </code></pre>
  
  <p>My .br files are located on a server with <code>proxy_pass</code>.</p>
  
  <pre><code>location / {
      ...
      proxy_pass http://app;
  }
  </code></pre>
  
  <p>And .br files have been generated on that <code>app</code> server:</p>
  
  <pre><code>$ ls -lh public/js/dist/index.js*
  -rw-r--r-- 1 mike wheel 1.2M Apr  4 09:07 public/js/dist/index.js
  -rw-r--r-- 1 mike wheel 201K Apr  4 09:07 public/js/dist/index.js.br
  </code></pre>
  
  <p>Pulling down the uncompressed file works:</p>
  
  <pre><code>wget https://example.com/js/dist/index.js
  </code></pre>
  
  <p>Pulls down 1,157,704 size uncompressed file.</p>
  
  <pre><code>wget -S --header="accept-encoding: gzip" https://example.com/js/dist/index.js
  </code></pre>
  
  <p>Pulls down a 309,360 size gzipped file.</p>
  
  <p>But:</p>
  
  <pre><code>wget -S --header="accept-encoding: br" https://example.com/js/dist/index.js
  </code></pre>
  
  <p>Still gets the full 1,157,704 size uncompressed file.</p>
  
  <p>I had <em>hoped</em> <code>brotli_static</code> would proxy the .br file requests too - sending something a GET request to the backend for the .br equivalent resource - but this doesn't seem to work.</p>
  
  <p><strong>Can brotli_static work through proxy_pass?</strong></p>