I bought macOS Big Sur and I'm trying to install php + nginx on it, but I have a problem all the time and can't add my domain correctly. I have this configuration:
usr/local/etc/php/7.3/php-fpm.d/www.conf
[www]
user = pcyrkl01
group = staff
listen = 127.0.0.1:9073
I try different configurations, but I can't find a solution to the problem, despite searching for several hours.
My virtualhost for admin.local
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /Users/pcyrkl01/ssl/default.crt;
ssl_certificate_key /Users/pcyrkl01/ssl/default.key;
server_name admin.local;
root /Users/pcyrkl01/sites/admin.local/web_admin;
index index.php index.html index.htm;
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app_dev.php/$1 last;
}
location ~ ^/(app|app_dev|config|index)\.php(/|$) {
fastcgi_pass 127.0.0.1:9073;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
fastcgi_param HTTPS off;
}
location ~* \.(eot|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
error_log /Users/pcyrkl01/web_log/symfony_error.log;
access_log /Users/pcyrkl01/web_log/symfony_access.log;
}
local.backend
server {
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /Users/pcyrkl01/ssl/default.crt;
ssl_certificate_key /Users/pcyrkl01/ssl/default.key;
server_name admin.local;
root /Users/pcyrkl01/sites/admin.local/web;
index index.php index.html index.htm;
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app_dev.php/$1 last;
}
location ~ ^/(app|app_dev|config|index)\.php(/|$) {
fastcgi_pass 127.0.0.1:9073;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
fastcgi_param HTTPS off;
}
location ~* \.(eot|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
error_log /Users/pcyrkl01/web_log/symfony_error.log;
access_log /Users/pcyrkl01/web_log/symfony_access.log;
}
my nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9073;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /usr/local/etc/nginx/fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9073;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
include servers
My file permission
-rw-r--r-- 1 pcyrkl01 staff 1.9K Oct 20 15:03 Dockerfile
-rw-r--r-- 1 pcyrkl01 staff 2.3K Oct 20 15:03 Dockerfile73
-rw-r--r-- 1 pcyrkl01 staff 2.2K Oct 20 15:03 README.md
drwxr-xr-x 9 pcyrkl01 staff 288B Oct 20 15:03 app
drwxr-xr-x 4 pcyrkl01 staff 128B Oct 20 15:15 bin
-rw-r--r-- 1 pcyrkl01 staff 4.0K Oct 20 15:03 composer.json
-rw-r--r-- 1 pcyrkl01 staff 345K Oct 20 15:03 composer.lock
-rwxr-xr-x 1 pcyrkl01 staff 1.8M Oct 20 15:03 composer.phar
drwxr-xr-x 3 pcyrkl01 staff 96B Oct 20 15:03 deploy
-rw-r--r-- 1 pcyrkl01 staff 662B Oct 20 15:03 deploy.php
-rw-r--r-- 1 pcyrkl01 staff 3.6K Oct 20 15:03 deploy_aws.php
-rw-r--r-- 1 pcyrkl01 staff 12K Oct 20 15:03 deploy_test.php
-rw-r--r-- 1 pcyrkl01 staff 787B Oct 20 15:03 docker-compose.dev.yml
drwxr-xr-x 5 pcyrkl01 staff 160B Oct 20 15:03 docs
drwxr-xr-x 6 pcyrkl01 staff 192B Oct 20 15:03 front
-rw-r--r-- 1 pcyrkl01 staff 13K Oct 20 15:03 gulpfile.js
-rw-r--r-- 1 pcyrkl01 staff 1.5K Oct 20 15:03 nagios.php
drwxr-xr-x 677 pcyrkl01 staff 21K Oct 20 15:12 node_modules
-rw-r--r-- 1 pcyrkl01 staff 287K Oct 20 15:12 npm-shrinkwrap.json
-rw-r--r-- 1 pcyrkl01 staff 290K Oct 20 15:03 package-lock.json
-rw-r--r-- 1 pcyrkl01 staff 769B Oct 20 15:03 package.json
-rw-r--r-- 1 pcyrkl01 staff 1.3K Oct 20 15:03 phpunit.xml.dist
drwxr-xr-x 5 pcyrkl01 staff 160B Oct 20 15:03 src
drwxr-xr-x 6 pcyrkl01 staff 192B Oct 20 15:03 tests
drwxr-xr-x 6 pcyrkl01 staff 192B Oct 20 15:15 var
drwxr-xr-x 65 pcyrkl01 staff 2.0K Oct 20 15:15 vendor
drwxr-xr-x 31 pcyrkl01 staff 992B Oct 20 15:15 web
drwxr-xr-x 7 pcyrkl01 staff 224B Oct 20 15:09 web_admin
drwxr-xr-x 6 pcyrkl01 staff 192B Oct 20 15:03 web_api
In /etc/hosts I have added:
127.0.0.1 admin.local local.backend
brew services list
nginx started pcyrkl01 /Users/pcyrkl01/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php@7.3 started pcyrkl01 /Users/pcyrkl01/Library/LaunchAgents/homebrew.mxcl.php@7.3.plist
The problem is that both hosts open to me instead of the site is the location /usr/local/var/www, instead of mine - Users/pcyrkl01/sites/local.admin/ web or web_admin