proxy_pass | rewrite | |
---|---|---|
Return | 200 with the content | 302 with the URL to the redirected page |
Content | To nginx, then the client | Second call skips nginx; returned through the redirect URL directly to client |
location /testing {proxy_pass https://news.yahoo.com/us;}
rewrite ^/(.*)$ https://www.newurl.com/$1-$http_x_header1 redirect
apiVersion: networking.k8s.io/v1kind: Ingressmetadata:name: my-ingress-nameannotations:nginx.org/mergeable-ingress-type: "master"nginx.org/server-snippets: |rewrite ....location /testing {....}spec:....
Annotation of nginx.org/rewriters:
nginx.org/rewriters: "serviceName=my-service-name rewrite=/my-new-endpoint"