Devin
Devin

Reputation: 505

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page

I'm running Ubuntu and have nginx installed. I originally had it configured and it was working as expected. I used a script (located here) to fix my nginx start and stop scripts. After I did this, I noticed my website now displays the nginx 'Welcome to nginx!' page without me changing my conf file. Now I can't get nginx to display my site. I can't find what is telling nginx to serve the file located at /usr/share/nginx/html/index.html. I've checked configuration files located in my sites-enabled and sites-available directory. I don't know where else to look. I've tried some grep-ing but to no avail.

Upvotes: 0

Views: 5574

Answers (1)

vvy
vvy

Reputation: 2073

When you rewrite the nginx.conf in the source code folder of nginx and install it first, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modifying the configure in the source code folder).

But when you do this secondly, the nginx.conf in the source code folder will be copied to /usr/local/nginx/conf/nginx.conf.default,and it usually doesn't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.default to assign its configure file every time.

There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above, which indicates the configure file clearly.

To handle this, I suggest to rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Upvotes: 2

Related Questions