Is this a request for help?
Yes.
What keywords did you search in NGINX Ingress controller issues before filing this one?
proxy-redirect-from/to(nginx-ingress) , proxy_pass(nginx)
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
FEATURE REQUEST
If this is a FEATURE REQUEST, please:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: open-api-service-ingress
namespace: java-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-redirect-from: "http://www.google.com"
nginx.ingress.kubernetes.io/proxy-redirect-to: "/one"
nginx.ingress.kubernetes.io/enable-access-log: "ture"
nginx.ingress.kubernetes.io/configuration-snippet: |
access_log /var/log/nginx/open-api_access.log upstreaminfo;
error_log /var/log/nginx/open-api_error.log notice;
spec:
rules:
NGINX Ingress controller version:
0.18.0
Kubernetes version (use kubectl version):
1.9.3
Closing. The annotation proxy-redirect-from/to works only when you define a host in the ingress rule.
@aledbf
Could you please tell me how to use it?When I define a host ,it's still not working.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: open-api-service-ingress
namespace: java-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-redirect-from: "http://www.google.com"
nginx.ingress.kubernetes.io/proxy-redirect-to: "/one/"
nginx.ingress.kubernetes.io/enable-access-log: "ture"
nginx.ingress.kubernetes.io/configuration-snippet: |
access_log /var/log/nginx/open-api_access.log upstreaminfo;
error_log /var/log/nginx/open-api_error.log notice;
spec:
rules:
Most helpful comment
@aledbf
Could you please tell me how to use it?When I define a host ,it's still not working.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: open-api-service-ingress
namespace: java-service
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-redirect-from: "http://www.google.com"
nginx.ingress.kubernetes.io/proxy-redirect-to: "/one/"
nginx.ingress.kubernetes.io/enable-access-log: "ture"
nginx.ingress.kubernetes.io/configuration-snippet: |
access_log /var/log/nginx/open-api_access.log upstreaminfo;
error_log /var/log/nginx/open-api_error.log notice;
spec:
rules:
http:
paths:
backend:
serviceName: open-api-service
servicePort: 8080