<p>We are setting up nginx with kubernetes for formio. We need the .com/ to point to the api server, and the .com/files/ to point to the pdf server. Here is the ingress config:</p>

<pre><code>  paths:
  - backend:
      serviceName: formio
      servicePort: 80
    path: /
  - backend:
      serviceName: formio-files
      servicePort: 4005
    path: /files/(.*)$
</code></pre>

<p>We have it setup that our PDFs are being stored in the path like /files/pdf/filename.
The issue is that whole path after /files/ also gets redirected to the PDF server, instead of just stopping at /files/</p>

<p>This is a common issue and it was caused by the path regex which you set. First, you need to understand clearly about it. The path regex <code>/files/(.*)$</code> will match all the path <code>/files/...</code>, no matter what you add after <code>/files/</code>. So it redirects all the requests with path <code>/files/...</code>. If you only want to redirect the PDF requests to the path <code>/files/pdf/...</code>, the solution is set the path regex as <code>/files/pdf/(.*)$</code>.</p>
