1 개요[ | ]
- k8s nginx php-fpm 유닉스 소켓 연동
zz-docker.conf
ini
Copy
[global]
daemonize = no
[www]
listen = /sock/php-fpm.sock
listen.mode = 0777
pm = static
pm.max_children = 20
nginx.conf
aconf
Copy
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
yaml
Copy
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 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.