Docroot is: /opt/homebrew/var/www
The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.
nginx will load all files in /opt/homebrew/etc/nginx/servers/.
To start nginx now and restart at login:
brew services start nginx
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/nginx/bin/nginx -g daemon off;
==> Summary
/opt/homebrew/Cellar/nginx/1.25.1: 26 files, 2.4MB
brew services start nginx
brew services start php
brew services
brew list php
brew list nginx
brew list
list packagesbrew list --versions
list with versionsbrew list --cask
list cask packagesbrew outdated
upgradeable packagesbrew outdated --cask
upgradeable cask packagesbrew leaves
packages without dependenciesbrew deps --tree --installed
show dependencieslook for something like
/opt/homebrew/etc/nginx/servers/
fastcgi_pass u
look for something like /opt/homebrew/Cellar/php/8.2.7_1/.bottle/etc/php/8.2/php-fpm.d/www.conf
and see listen = 127.0.0.1:9000
server {
listen 80;
server_name dome-laravel-10.local;
root "/Users/Firstname.lastname/mywww/domelaravel-10/public";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_intercept_errors off;
include fastcgi_params;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
}
You may see some errors like:
Error: Failure while executing;
/bin/launchctl bootstrap gui/502 /Users/Martin.Hearn/Library/LaunchAgents/homebrew.mxcl.nginx.plistexited with 5.
It happens when a previous postgres process doesn't terminate properly (maybe because you killed a psql process in activity monitor or otherwise). Restarting appears to properly unlock/delete the postmaster.pid file where "start" doesn't. Source