# Re: alias

**URL:** <https://www.ruby-forum.com/t/re-alias/238014>\
**Category:** NGINX\
**Created:** [December 11, 2013, 9:21pm UTC](https://www.ruby-forum.com/t/re-alias/238014 "2013-12-11T21:21:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 11, 2013, 9:21pm UTC](https://www.ruby-forum.com/t/re-alias/238014/1 "2013-12-11T21:21:32Z")

</div>

> On Tue, Dec 10, 2013 at 10:17:25PM +0000, Matthew Ngaha wrote:

> just after the server\_name line and reloading nginx.
> 
> If “curl -i [http://localhost/test/](http://localhost/test/)” does not show you “This is a test”,  
> then that’s your problem.

I think that’s the problem also. After doing that, curl returns 404  
Not Found aswell. I then changed root from html to something else just  
to test it was using a different configuration file. I changed it on  
both:

/usr/local/nginx-1.4.3/conf/nginx.conf  
/usr/local/nginx/conf-1.4.3/nginx.conf.default

but localhost still returns the main nginx welcome index page and not  
the index.html in my test root dir that was in /var/www/testing

I ran the linux command “locate” and here’s its output…

:~$ locate nginx.conf  
/home/matthew/src/nginx-1.4.3/conf/nginx.conf  
/usr/local/nginx-1.4.3/conf/.nginx.conf.swp  
/usr/local/nginx-1.4.3/conf/nginx.conf  
/usr/local/nginx-1.4.3/conf/nginx.conf.default  
/usr/local/nginx-1.4.3/conf/nginx.conf~

I wasn’t aware of the 1st result returned so i also edited this conf  
file. But still no luck. I have no idea where to look for the file or  
how to pick a default one for nginx to always use:(

---

<div class="post-metadata">

**Author:** ![Matthew\_Ngaha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Matthew\_Ngaha](https://www.ruby-forum.com/u/Matthew_Ngaha)\
**Post date:** [December 12, 2013, 12:37am UTC](https://www.ruby-forum.com/t/re-alias/238014/2 "2013-12-12T00:37:48Z")

</div>

On Wed, Dec 11, 2013 at 08:20:51PM +0000, Matthew Ngaha wrote:

> > On Tue, Dec 10, 2013 at 10:17:25PM +0000, Matthew Ngaha wrote:

> > That suggests that the configuration you are editing, and the  
> > configuration that nginx is using, are not the same.

> /home/matthew/src/nginx-1.4.3/conf/nginx.conf  
> /usr/local/nginx-1.4.3/conf/.nginx.conf.swp  
> /usr/local/nginx-1.4.3/conf/nginx.conf  
> /usr/local/nginx-1.4.3/conf/nginx.conf.default  
> /usr/local/nginx-1.4.3/conf/nginx.conf~
> 
> I wasn’t aware of the 1st result returned so i also edited this conf  
> file. But still no luck. I have no idea where to look for the file or  
> how to pick a default one for nginx to always use:(

That’s something you’ll have to find.

“ps” with arguments may let you see which nginx binary is running,  
and it might show you which config file it is reading (if it not the  
compiled-in default).

Until you can reliably stop and start nginx, configuration changes  
are pointless.

(Just changing the config file will do nothing, until you tell nginx to  
read the changed config file.)

Good luck with it,

## f

Francis D. removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Matthew\_Ngaha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Matthew\_Ngaha](https://www.ruby-forum.com/u/Matthew_Ngaha)\
**Post date:** [December 17, 2013, 9:43pm UTC](https://www.ruby-forum.com/t/re-alias/238014/3 "2013-12-17T21:43:21Z")

</div>

On Sat, Dec 14, 2013 at 01:04:59AM +0000, Matthew Ngaha wrote:

Hi there,

> So it seems the reloading wasn’t taking effect and only did  
> after a restart of my PC. i’ve beeb typing “sudo service nginx  
> reload” after editing … why isn’t this working, do i have to do  
> something else?

The best reply is “what do your logs say?”.

You should probably learn exactly what “sudo service nginx reload”  
does on your machine.

“service nginx” probably runs the shell script /etc/init.d/nginx.

That possibly runs an nginx binary with a named configuration file.

If it does, then that is the one configuration file that matters.

If it does not, then you running the same nginx binary with a “-V”  
argument should indicate what the one configuration file that matters  
is.

After that, you can edit that file to introduce a deliberate error, and  
see what your “sudo service nginx reload” shows, and compare that with  
what happens when you run nginx directly with appropriate arguments. If  
there is an error in the config file, you should see a clear indication  
of it.

Running nginx with a “-h” argument shows the help text.

Good luck with it,

## f

Francis D. removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Matthew\_Ngaha](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ec8ea/32.png) [@Matthew\_Ngaha](https://www.ruby-forum.com/u/Matthew_Ngaha)\
**Post date:** [December 14, 2013, 2:05am UTC](https://www.ruby-forum.com/t/re-alias/238014/4 "2013-12-14T02:05:48Z")

</div>

hey so out of all those config files i edited, i reloaded all of them  
and the changes weren’t made. I think i stumbled onto the problem  
today. whenever it didn’t work i always put the files back to their  
defaults before switching off my PC but this time i didn’t. Today i  
didn’t touch any config files but finally nginx was finding the new  
location. So it seems the reloading wasn’t taking effect and only did  
after a restart of my PC. i’ve beeb typing “sudo service nginx  
reload” after editing … why isn’t this working, do i have to do  
something else?
