kauth-coder commented on issue #410:
URL:
https://github.com/apache/rocketmq-dashboard/issues/410#issuecomment-4540743546
自己回复一下,已经解决了,解决方案 在 nginx 层覆写 Origin、Referer
比如说我这个是用k3s 部署的 用的 nginx Ingress 直接指定Origin、Referer. yaml脚本如下:
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: rocketmq-dashboard
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: rocketmq-dashboard
template:
metadata:
labels:
app: rocketmq-dashboard
spec:
containers:
- name: dashboard
image: apacherocketmq/rocketmq-dashboard:2.1.0
env:
- name: JAVA_OPTS
value: "-Drocketmq.namesrv.addr=rocketmq-nameserver:9876"
ports:
- containerPort: 8082
---
apiVersion: v1
kind: Service
metadata:
name: rocketmq-dashboard
namespace: default
spec:
type: ClusterIP
selector:
app: rocketmq-dashboard
ports:
- port: 8080
targetPort: 8082
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rocketmq-dashboard-ingress
namespace: default
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header Origin "http://localhost:3003";
proxy_set_header Referer "http://localhost:3003";
spec:
ingressClassName: nginx
rules:
- host: rocketmq.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: rocketmq-dashboard
port:
number: 8080
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]