<p>is it possible to set RewriteRule in kubernetes ingress?</p>
<p>here is my nginx VirtualHost settings</p>
<pre><code>&lt;VirtualHost *:80&gt;
    RewriteEngine On
    RewriteRule ^/hello/?$ /mydirectory.index.html [L]
&lt;/VirtualHost&gt;
</code></pre>
<p>then I would like to set the same RewriteRule in ingress</p>
<pre><code>    kind: Ingress
    metadata:
    annotations:
        nginx.ingress.kubernetes.io/configuration-snippet: |
        RewriteRule ^/hello/?$ /mydirectory/index.html [L] // something like this!
    spec:
    rules:
        - host: &quot;hello.com&quot;
        http:
            paths:
            - path: /
                backend:
                serviceName: myService
                servicePort: 80
                rewriteRules:
                - '^/hello/?$ /mydirectory/index/html [L]' // something like this!
</code></pre>

kokojustin
<p>look at the nginx ingress controller documentation <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">here</a>. There are example configurations and explanations on how to set rewrite rule on kubernetes ingress resource.</p>
