NGINX change config location -
NGINX change config location -
i'm working on getting nginx configured on server , i've been able of files /usr/local/nginx/html/. i've created nginx.conf file in /usr/local/nginx/conf. contains is:
server { root /usr/local/nginx/html; index index.html index.html; } i've been using /usr/local/ because that's thing have permissions write in. when go @ site, still nginx index.html page message:
this default index.html page distributed nginx on epel. located in /usr/share/nginx/html.
you should set content in location of selection , edit root configuration directive in nginx configuration file /etc/nginx/nginx.conf.
i guess question is, how can configure nginx.conf file correctly uses conf file , pulls correction location site files?
whether you're starting nginx in shell or using daemon service (which wrapper around command line api), reply lies in the command line api.
as learned, default location nginx looks in configuration file /etc/nginx/nginx.conf, can pass in arbitrary path -c flag. e.g.:
$ nginx -c /usr/local/nginx/conf a couple other notes:
i uncertainty there's reason repeat "index.html" in server block. i name configuration file "nginx.conf" (you indicate it's named "conf"). it's standard. familiarize command line flag-t, checks create sure configuration file works. run nginx -t every time after modifying configuration file , spit out syntax errors. reload configuration after changes, utilize nginx -s reload. nginx
Comments
Post a Comment