title: How to do wildcard with nodejs proxy middleware library into path
body: <p>I was trying to setup this proxy middleware project to wild card all different types of requests but it looks like it is only static.</p>
  <p>Meaning, if I send in /test/test/test.html it will only go to root of proxy say example.org.</p>
  <p>I want to be able to do:</p>
  <p>/test/test/test.html into example.org/test/test/test.html.
  &quot;dependencies&quot;: {
  &quot;express&quot;: &quot;^4.18.1&quot;,
  &quot;http-proxy-middleware&quot;: &quot;^2.0.6&quot;
  },</p>
  <pre><code>    // Typescript - proxy server
  // https://github.com/chimurai/http-proxy-middleware/tree/v2.0.4#readme
  
  import express from 'express';
  import https from 'https';
  import fs from 'fs';
  import { createProxyMiddleware, Filter, Options, RequestHandler } from 'http-proxy-middleware';
  
  // SSL configuration
  const options = {
    key: fs.readFileSync('./key.pem'),
    cert: fs.readFileSync('./cert.pem')
  };
  
  // Express version of proxy
  const app = express();
  
  const simpleRequestLogger = (proxyServer, options) =&gt; {
    proxyServer.on('proxyReq', (proxyReq, req, res) =&gt; {
      console.log(`[HPM] [${req.method}] ${req.url}`); // outputs: [HPM] GET /users
    });
  };
  
  console.log('[PROXY] Starting on port 3000 - Hola Mundo!');
  
  app.use('/api/*', createProxyMiddleware({ 
    target: 'https://www.7timer.info/bin/astro.php?lon=113.2&amp;lat=23.1&amp;ac=0&amp;unit=metric&amp;output=json&amp;tzshift=0', 
    changeOrigin: true,
    logLevel: 'debug',
    secure: false
  }));
  
  app.use('/static-tools/**', createProxyMiddleware({ 
    target: 'http://dev.com/localapp/static-tools', 
    changeOrigin: true,
    logLevel: 'debug',
    secure: false
  }));
  
  
  //app.listen(3000);
  
  const server = https.createServer(options, app);
  server.listen(3000);
  </code></pre>