osx - Mac Nginx. Can't change the default page -


i sadly can't nginx default page settings work. have deleted preinstalled html files in /var/www/, still gets load default one.. (also cleared browser cache)

my current files:

nginx.conf

    worker_processes  1;  error_log  /usr/local/etc/nginx/logs/error.log debug;  events {     worker_connections  1024; }  http { include             mime.types; default_type        application/octet-stream;  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '                   '$status $body_bytes_sent "$http_referer" '                   '"$http_user_agent" "$http_x_forwarded_for"';  access_log  /usr/local/etc/nginx/logs/access.log  main;  sendfile            on;  keepalive_timeout   65;  index index.html index.php;  include /usr/local/etc/nginx/sites-enabled/*;  } 

sites-available/default

    server { listen       80; server_name  localhost; root       /var/www/;  access_log  /usr/local/etc/nginx/logs/default.access.log  main;  location / {     include   /usr/local/etc/nginx/conf.d/php-fpm; }  error_page  404     /404.html; error_page  403     /403.html; } 

sites-enabled contains aliases of files in sites-available.

hope didn't miss there!

thank in advance! :)

ok... let's try this:

in usr/local/etc/nginx/sites-available/default, replace entire location / block

location / {   try_files $uri $uri/ /index.php$is_args$args; } 

this tells nginx first named file, directory name, pass onto index.php. (to learn more how nginx location block matching, suggest this digital ocean article.)

then, in /usr/local/etc/nginx/conf.d/php-fpm, delete try_files $uri = 404; line.

i'm pretty sure it's line causing /var/www404 lookup because there's not supposed space between = 404. also, try_files in section doesn't much.

as it's pulling content from, 'clone example virtual host' step copying index.html /var/www.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -