title: express middleware redirects not working
body: <p>I have the next express server i want redirect .js files to the correspond .js.gz file but when i request /static/common.js don't redirects</p>
  
  <p>Response Headers</p>
  
  <p>HTTP/1.1 200 OK
  X-Powered-By: Express
  Accept-Ranges: bytes
  Cache-Control: public, max-age=0
  Last-Modified: Wed, 29 Mar 2017 14:30:17 GMT
  ETag: W/"2b4084-15b1a796ca8"
  Content-Type: application/javascript
  Content-Length: 2834564
  Date: Wed, 29 Mar 2017 16:25:53 GMT
  Connection: keep-alive</p>
  
  <pre><code>// define the folder that will be used for static assets
  const staticFolder = './';
  app.use(favicon(`${staticFolder}/icons/favicon.ico`));
  app.use('/static', Express.static(staticFolder));
  app.use('/', Express.static(`${staticFolder}/sw`));
  app.use(locale(supported));
  
  app.get('*.js', (req, res, next) =&gt; {
    const reqI = req;
    reqI.url += '.gz';
    res.set('Content-Encoding', 'gzip');
    next();
  });
  
  // universal routing and rendering
  app.get('*', (req, res) =&gt; {
  </code></pre>
  
  <p>I am using nginx inside a docker image with the next configuration:</p>
  
  <pre><code>server {
      listen 80;
      server_name api.inmoblex.com;
      return 301 https://$host$request_uri;
  }
  
  server {
   listen 443 ssl http2;
   server_name api.inmoblex.com;
   charset utf-8;
  
   ssl_certificate /www/certs/fullchain.pem;
   ssl_certificate_key /www/certs/privkey.pem;
  
   location / {
       proxy_pass http://web:8000;
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }
  }
  
  server {
      listen 80 default_server;
      server_name inmoblex.com www.inmoblex.com;
      return 301 https://$host$request_uri;
  }
  
  server {
  
     listen 443 ssl http2 default_server;
     server_name inmoblex.com www.inmoblex.com;
     charset utf-8;
  
     ssl_certificate /www/certs/fullchain.pem;
     ssl_certificate_key /www/certs/privkey.pem;
  
     location / {
         proxy_pass http://node:3000;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
  
  }
  </code></pre>