方案
问题
投掷"缺少请求标题SIGNATURE"执行api时出现异常。
问题
如何使用自定义标头从客户端传递到后端 NGINX Ingress控制器?
工件
Springboot Controller Code Snippet
public ResponseEntity<TransactionDTO> get(
@RequestHeader("SIGNATURE") String apiSignature,
@RequestHeader("application/json") String contentType,
@PathVariable Long id)
Ingress Controller YAML
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: api-ingress
annotations:
kubernetes.io/ingress.class: nginx
ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- host: api.domain.com.br
http:
paths:
- path: /manager
backend:
serviceName: api-svc
servicePort: 8086
&#13;
提前致谢...