当前位置: 首页 > 后端技术 > PHP

php和nginx的两种处理方式

时间:2023-03-29 17:56:02 PHP

1.IP:端口监听方式php-fpmdockerpullPHP:2.4-alpinenginx.conffastcgi_pass127.0.0.1:9000;php-fpmnginx.conflocationinthecontainer/php{proxy_set_headerHost$host:$服务器端口;proxy_passhttp://138.38.38.111:80/;}2.UDS监听php-fpmlisten=/tmp/php-fpm.socknginx.conffastcgi_passunix:/tmp/php-fpm.sock;3.注意php-fpm使用ip:port方式建立连接,nginx做不使用unixsocket方式建立连接,只使用ip:port方式建立连接