nginx入口FCGI + wordpress:fpm-alpine。 302重定向无限循环

时间:2019-12-27 09:50:41

标签: wordpress nginx kubernetes nginx-ingress

所以FGCI今年问世了。想测试一些WordPress,但我听说它有一些重写规则需要遵循。无法完全正确地使用nginx.ingress.kubernetes.io/rewrite-targetnginx.ingress.kubernetes.io/configuration-snippet。谁能帮我翻译这个入口定义,以便我可以只使用nginx-ingress和wordpress fpm吗?

apiVersion: v1
kind: ConfigMap
metadata:
  name: word-cm
data:
  SCRIPT_FILENAME: "/var/www/html/index.php"

---

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/backend-protocol: "FCGI"
    nginx.ingress.kubernetes.io/fastcgi-index: "index.php"
    nginx.ingress.kubernetes.io/fastcgi-params-configmap: "word-cm"
    nginx.ingress.kubernetes.io/configuration-snippet: |
        location / {
          $uri $uri/ /index.php?$args;
        } 
  name: word
spec:
  rules:
  - host: word.press.site
    http:
      paths:
      - backend:
          serviceName: word
          servicePort: fastcgi

当前尝试基于https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/

获取此信息
-------------------------------------------------------------------------------
W1227 09:49:02.610057       6 queue.go:130] requeuing mcsh/word, err
-------------------------------------------------------------------------------
Error: exit status 1
2019/12/27 09:49:02 [emerg] 807#807: unknown directive "$uri" in /tmp/nginx-cfg091168912:668
nginx: [emerg] unknown directive "$uri" in /tmp/nginx-cfg091168912:668
nginx: configuration file /tmp/nginx-cfg091168912 test failed

-------------------------------------------------------------------------------

没有它,我得到302s来无限地安装页面。

0 个答案:

没有答案