Re: alias

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/” 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:(

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. [email protected]

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. [email protected]

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?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs