Home  >  Article  >  Backend Development  >  Two processing methods of php and nginx

Two processing methods of php and nginx

藏色散人
藏色散人forward
2019-09-25 09:10:442044browse

Two processing methods of php and nginx

1.IP:Port listening method

php-fpm

docker pull PHP:2.4-alpine

nginx.conf

fastcgi_pass 127.0.0.1:9000;

php-fpm nginx.conf in the container

location /php
       {         
            proxy_set_header Host $host:$server_port;
            proxy_pass http://138.38.38.111:80/;
       }

2.UDS mode monitoring

php-fpm

listen = /tmp/php-fpm.sock

nginx.conf

fastcgi_pass unix:/tmp/php-fpm.sock;

3. Note that

php-fpm uses ip:port to establish the link,

nginx does not use unix socket to establish the link Link, just use ip:port to establish a connection.

Related recommendations: "PHP Tutorial"

The above is the detailed content of Two processing methods of php and nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete