Getting started

James Read jamesread5737 at gmail.com
Wed Dec 11 20:54:24 UTC 2019


On Wed, Dec 11, 2019 at 8:30 PM Francis Daly <francis at daoine.org> wrote:

> On Tue, Dec 10, 2019 at 11:50:21PM +0000, James Read wrote:
>
> Hi there,
>
> nginx uses a single config file, which may "include" other files.
>
> When a request comes in to nginx, it chooses one "server" to handle
> the request; and then (with some exceptions) it chooses one "location"
> to handle the request.
>
> > I edited the config file as follows:
> >
> > http {
> >         server {
> >                 location / {
> >                         root /www;
> >                 }
> >         }
> > ...
> > }
> >
> > I then reloaded the config file with sudo nginx -s reload. I created a
> test
> > file at /www/index.html then when I tried to load the page in my browser
> I
> > still got the default Welcome to nginx! page.
> >
> > What am I doing wrong?
>
> One possibility is that your browser had cached its previous request
> to nginx, so it never asked nginx for the request this time. If you
> use "curl" to make a test request of the page, it should avoid that
> possibility.
>
> Another possibility is that the config file that you edited is not the
> config file that the running nginx is using.
>
> Or maybe, the server{} that you edited is not the server{} that nginx
> chooses to handle the particular request that you made.
>
> The nginx access log file should show something if the request got to
> nginx -- that might rule out the first possibility above.
>
> The nginx error log -- especially if it is in "debug" mode -- may show far
> more than you ever want to know about what nginx is doing with a request.
>
> That *might* show something about the other possibilities.
>
>
Access log shows that page hasn't changed http code 304:

127.0.0.1 - - [11/Dec/2019:20:46:42 +0000] "GET / HTTP/1.1" 304 0 "-"
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/79.0.3945.79 Safari/537.36"


> > I also tried editing the page at /usr/share/nginx/html/index.html None of
> > my edits seem to have any effect. When I tried to load the page in my
> > browser I still got the default Welcome to nginx! page.
>
> That one is most likely browser caching, I guess.
>
> Cheers,
>
>         f
> --
> Francis Daly        francis at daoine.org
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20191211/3ee77150/attachment.htm>


More information about the nginx mailing list