Instalado o nginx e o php-fpm via Homebrew.
Desativei o Apache 2.4 nativo que acompanha o OSX executando:
glfx:~ glfx$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Até diz que não está mais funcionando:
/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
Então eu executo meu nginx e verifico o que está vinculado à minha porta 80:
glfx:~ glfx$ lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 266 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 267 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 268 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 269 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 270 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 271 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 272 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
nginx 273 glfx 9u IPv4 0x6267c63df8016e53 0t0 TCP *:http (LISTEN)
Minhas configurações do nginx são:
worker_processes 8;
user glfx staff;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "http_x_forwarded_for"';
access_log logs/nginx/access.log main;
error_log logs/nginx/error.log debug;
sendfile on;
tcp_nopush on;
tcp_nodelay off;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
server_names_hash_bucket_size 128;
server_names_hash_max_size 20000;
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 20000;
underscores_in_headers on;
include /usr/local/etc/nginx/sites/*;
}
E configuração do site:
server {
listen 80;
server_name signals.dev;
root /Users/glfx/Projects/signalsplatform.dev/public_html;
access_log /usr/local/var/log/nginx/signals.dev.access.log;
error_log /usr/local/var/log/nginx/signals.dev.error.log;
rewrite ^/app_dev\.php/?(.*)$ /$1 permanent;
location / {
index app_dev.php;
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /app_dev.php/$1 last;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
root /Users/glfx/Projects/signalsplatform.dev/public_html;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Quando tento acessar os sinais.dev no meu navegador - Nenhuma conexão com o servidor da Web, apesar de os sinais.dev:8080 estarem fornecendo o Nginx 404 não encontrado.
Por que não consigo ligar meu nginx para usar a porta 80?