K8s nginx php-fpm 연동

1 개요[ | ]

k8s nginx php-fpm 유닉스 소켓 연동
zz-docker.conf
[global]
daemonize = no

[www]
listen = /sock/php-fpm.sock
listen.mode = 0777
pm = static
pm.max_children = 20
nginx.conf
location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }
    fastcgi_param HTTP_PROXY "";

    #fastcgi_pass 127.0.0.1:9000;
    fastcgi_pass unix:/sock/php-fpm.sock;

    fastcgi_index index.php;
    include fastcgi_params;
}
deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: php-fpm-nginx-deployment
spec:
  selector:
    matchLabels:
      app: php-fpm-nginx
  template:
    metadata:
      labels:
        app: php-fpm-nginx
    spec:
      containers:
      - name: php-fpm
        image: php:7.4-fpm
        volumeMounts:
        - name: vol-sock
          mountPath: /sock
      - name: nginx
        image: nginx:1.21
        volumeMounts:
        - name: vol-sock
          mountPath: /sock
      volumes:
      - name: vol-sock
        emptyDir: {}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}