Query on nginx. conf file regarding redirection.

Francis Daly francis at daoine.org
Sat Oct 31 22:56:37 UTC 2020

On Sat, Oct 31, 2020 at 06:48:00AM +0530, Kaushal Shriyan wrote:
> On Sat, Oct 31, 2020 at 5:13 AM Francis Daly <francis at daoine.org> wrote:

Hi there,

thanks for the extra information.

> > Something like
> >
> >   /usr/local/sbin/nginx -c /etc/nginx.conf -T | grep -e 'server\|listen'
> >
> > where the first three words match whatever your system is doing, will
> > probably be helpful.

> I am sharing the output of cat /etc/nginx/nginx.conf

> >     include /etc/nginx/conf.d/*.conf;

That line *might* add lots more config, but...

> #nginx -c /etc/nginx/nginx.conf -T | grep -e 'server\|listen'
> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /etc/nginx/nginx.conf test is successful
> #    server {
> #     listen 80;
>     server {
>      listen 80;

..that output shows that there is no other config used here.

What error message, if any, do you get when you do

  nginx -c /etc/nginx/nginx.conf

? (I suspect it will complain that it can't bind to port 80, because
another nginx is listening there.)

As a test, if you kill any running nginx process, and do

  nginx -c /etc/nginx/nginx.conf

what happens if you repeat your test request?


Francis Daly        francis at daoine.org

More information about the nginx mailing list