In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Various methods have been tried on the Internet, such as dealing with a single NGINX container in a single machine, or deploying multiple sites with a single PHP-FPM container, all of which are unsuccessful.
After reflection and summary, two methods have been successfully implemented at present:
Single Nginx, multiple PHP-FPM, single Nginx, single PHP-FPM
Single Nginx, multiple PHP-FPM
Docker-compose.yml
Version:'2' services: nginx-1.15.1: image: nginx:laster ports:-"80:80" volumes: -. / htdocs:/usr/local/nginx/html -. / etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -. / etc/nginx/conf.d:/etc/nginx/conf.d -. / log/nginx:/var/ Log/nginx networks:-leoedu-network php-fpm-a: image: php-fpm:laster volumes: -. / htdocs/a.com:/var/www/html networks:-leoedu-network php-fpm-b: image: php-fpm:laster volumes: -. / htdocs/b.com:/var/www/html networks:-leoedu-network networks: leoedu-network: driver: bridge
Nginx profile:
Server {listen 80; charset utf-8; server_name a.com; root / usr/local/nginx/html/a.com; index index.html index.htm index.php; error_log / var/log/nginx/a.com-error.log; access_log / var/log/nginx/a.com-access.log; location ~\ .php$ {fastcgi_pass php-fpm-a:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name Include fastcgi_params;}}
Single Nginx, single PHP-FPM
Docker-compose.yml
Version:'2' services: nginx-1.15.1: image: nginx:laster ports:-"80:80" volumes: -. / htdocs:/usr/local/nginx/html -. / etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -. / etc/nginx/conf.d:/etc/nginx/conf.d -. / log/nginx:/var/ Log/nginx networks:-leoedu-network php-fpm-7.2.5: image: php-fpm:laster volumes: -. / htdocs:/var/www/html networks:-leoedu-networknetworks: leoedu-network: driver: bridge
The key points of NGINX configuration are:
Astcgi_param SCRIPT_FILENAME / var/www/html/nick.com/$fastcgi_script_name
For the specific reason, I'll make it up later when I'm free. This article is just a record.
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.