nginx does not execute an index.php file in the http://localhost root. I also changed the default_type application/octet-stream; to default_type application/html; but no luck. Below is the nginx.conf file:
user nobody;
worker_processes 1;
error_log /usr/local/Cellar/nginx/1.4.6/logs/error.log;
pid /usr/local/Cellar/nginx/1.4.6/logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include /usr/local/etc/nginx/mime.types;
include /usr/local/etc/nginx/fastcgi.conf;
default_type application/octet-stream;
access_log /usr/local/var/log/nginx/access.log;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name localhost;
access_log /usr/local/Cellar/nginx/1.4.6/logs/localhost.access.log combined;
location / {
root /Users/apiah/Websites/test;
index index.html index.htm index.php;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/etc/nginx/fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Also, here is the information from nginx -V command in terminal:
TLS SNI support enabled configure arguments: --prefix=/usr/local/Cellar/nginx/1.4.6 --with-http_ssl_module --with-pcre --with-ipv6 --sbin-path=/usr/local/Cellar/nginx/1.4.6/bin/nginx --with-cc-opt='-I/usr/local/Cellar/pcre/8.34/include -I/usr/local/Cellar/openssl/1.0.1f/include' --with-ld-opt='-L/usr/local/Cellar/pcre/8.34/lib -L/usr/local/Cellar/openssl/1.0.1f/lib' --conf-path=/usr/local/etc/nginx/nginx.conf --pid-path=/usr/local/var/run/nginx.pid --lock-path=/usr/local/var/run/nginx.lock --http-client-body-temp-path=/usr/local/var/run/nginx/client_body_temp --http-proxy-temp-path=/usr/local/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/usr/local/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/usr/local/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/usr/local/var/run/nginx/scgi_temp --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-http_gzip_static_module
Thanks for your help.

所有评论(0)