Note: nginx installed via brew Website root directory: /opt/homebrew/var/www nginx configuration directory: /opt/homebrew/etc/nginx/ Assumption: There is a project named TestProject and the domain name is bd.testproject.com Step 1: Set up IP and domain name mapping (that is, add hosts)# Terminal vim /etc/hosts # Add and save 127.0.0.1 bd.testproject.com Step 2: Create a new site configuration file directory# Terminal mkdir /opt/homebrew/etc/nginx/vhosts Step 3: Create a new site configuration fileCreate a new configuration file named bd.testproject.com_80.conf in the /opt/homebrew/etc/nginx/vhosts directory. The content of the configuration file is (you can change the configuration content as needed): server { listen 80; server_name bd.testproject.com; root "/opt/homebrew/var/www/bd.testproject.com"; location / { index index.php index.html error/index.html; autoindex off; } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } } Step 4: Introduce site configuration in nginx default configuration file # Terminal vim /opt/homebrew/etc/nginx/nginx.conf # Add server_names_hash_bucket_size 64 in the file http{}; # Modify the server name length, which can only be a multiple of 32 include /opt/homebrew/etc/nginx/vhosts/*; # Introduce site configuration Step 5: Restart nginx# Terminal nginx -s reload Please ignore me and start fastcgi /usr/local/php/bin/php-cgi -b 9000 This is the end of this article about the implementation of Mac M1 Nginx multi-site configuration. For more relevant Mac M1 Nginx multi-site content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: The difference between ID and Name attributes of HTML elements
>>: Example code for implementing hexagonal borders with CSS3
The width of the parent container is fixed. In or...
Omit the protocol of the resource file It is reco...
This article example shares the specific code for...
Use examples to familiarize yourself with the mean...
Recently, the project uses kubernetes (hereinafte...
1. Triangle Border settings Code: width: 300px; h...
I have been using the CentOS purchased by Alibaba...
I want to achieve a situation where the width of ...
1. Install the cross-system file transfer tool un...
This article uses the crontab command in the Linu...
Communication between containers 1. Network shari...
Quickly modify the table structure of a MySQL tab...
Preface: During database operation and maintenanc...
Preface: I encountered a requirement to extract s...
Table of contents 1. Vue life cycle 2. Hook funct...