【发布时间】:2021-01-20 19:03:57
【问题描述】:
我正在尝试为自定义域启用 https 以进行对讲设置。
documentation 告诉我们:
server {
listen 443 ssl;
server_name your-help-site.custom-domain.com; # replace this with your domain
ssl_certificate /path/to/your/fullchain.pem;
ssl_certificate_key /path/to/your/privatekey.pem;
location / {
# using "set" is important as IP addresses of Intercom servers
# changes dynamically. "set" enables nginx to follow dynamic IPs
set $intercom "https://custom.intercom.help:443";
proxy_set_header Host $host;
proxy_pass $intercom;
}
}
我试过这种方法:
resource kubernetes_ingress help_ingress {
metadata {
name = "help-ingress"
annotations = {
"certmanager.k8s.io/cluster-issuer" = "letsencrypt-prod"
"kubernetes.io/ingress.class" = "nginx"
"nginx.ingress.kubernetes.io/permanent-redirect" = "http://custom.intercom.help"
"nginx.ingress.kubernetes.io/rewrite-target" = "/"
"ingress.kubernetes.io/force-ssl-redirect" = false
"nginx.ingress.kubernetes.io/from-to-www-redirect" = true
}
}
spec {
tls {
secret_name = "help-cert"
hosts = [local.help_url, "www.${local.help_url}"]
}
rule {
host = "${local.help_url}"
http {
path {
path = ""
backend {
service_name = "fake"
service_port = 80
}
}
}
}
}
}
但它只给了我一个重定向到https://custom.intercom.help
如何使用k8s nginx ingress 实现proxy_path?
【问题讨论】:
-
您是否尝试按照here 的描述配置
proxy_pass?您可以使用 configuration-snippet 和 server-snippet 为您的 nginx 入口使用自定义配置
标签: ssl kubernetes gcloud nginx-ingress intercom