Two processing methods of php and nginx

藏色散人
Release: 2023-04-07 13:04:02
forward
2132 people have browsed it

Two processing methods of php and nginx

1.IP:Port listening method

php-fpm

docker pull PHP:2.4-alpine
Copy after login

nginx.conf

fastcgi_pass 127.0.0.1:9000;
Copy after login

php-fpm nginx.conf in the container

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

2.UDS mode monitoring

php-fpm

listen = /tmp/php-fpm.sock
Copy after login

nginx.conf

fastcgi_pass unix:/tmp/php-fpm.sock;
Copy after login

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!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!