I found many links regarding this type of topic , so far i still could not solve my problem. I have just installed nginx via homebrew. Here are the steps that i did :
-
Added site name to etc/hosts
127.0.0.1 mysite.com
-
On my usr/local/etc/nginx, i created folder using
mkdir sites
(most instructions i have read so far already have sites-enabled or sites-default on thier setup, but mine was clean so i created one.) Then within the folder i created file just using vim :
vim mysite
then in the file i have this :
server { listen 80; server_name mysite.com; root /Users/myname/mysite/mainsite; client_max_body_size 10M; # serve static files location ~ ^/(images|javascript|js|css|flash|media|static)/ { expires 30d; } location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php$is_args$args; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /opt/local/share/nginx/html; } location ~ \\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param FF_BOOTSTRAP_ENVIRONMENT dev; fastcgi_param FF_BOOTSTRAP_CONFIG webroot/dev; fastcgi_buffer_size 1024k; fastcgi_buffers 1024 1024k; fastcgi_busy_buffers_size 1024k; include /usr/local/etc/nginx/fastcgi.conf; } }
After this i include my created folder to nginx.conf and nginx.cnf.default but after this i still get a 404 error. The above configuration on mysite file, except for some directory changes, worked on my other computer but some how i cant replicate for it to work, I tried revising and editing my directory in root but i still get 404. Did I miss some important stuff when configuring? Or what are the other possible reasons why i cannot access mysite.com after the above configuration or how i would get 404. Also i think no other background applications are currently running because i have just restarted the computer to see it the site doesnt work.. Any more suggestions why this might be happening? Thanks in advance
404 :(