Forum: NGINX nginx-0.7.53

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-27 14:25
(Received via mailing list)
Changes with nginx 0.7.53                                        27 Apr
2009

    *) Change: now a log set by --error-log-path is created from the
very
       start-up.

    *) Feature: now the start up errors and warnings are outputted to an
       error_log and stderr.

    *) Feature: the empty --prefix= configure parameter forces nginx to
use
       a directory where it was run as prefix.

    *) Feature: the -p switch.

    *) Feature: the -s switch on Unix platforms.

    *) Feature: the -? and -h switches.
       Thanks to Jerome Loyet.

    *) Feature: now switches may be set in condensed form.

    *) Bugfix: nginx/Windows did not work if configuration file was
given
       by the -c switch.

    *) Bugfix: temporary files might be not removed if the
"proxy_store",
       "fastcgi_store", "proxy_cache", or "fastcgi_cache" were used.
       Thanks to Maxim Dounin.

    *) Bugfix: an incorrect value was passed to mail proxy
authentication
       server in "Auth-Method" header line; the bug had appeared
       in 0.7.34.
       Thanks to Simon Lecaille.

    *) Bugfix: system error text descriptions were not logged on Linux;
       the bug had appeared in 0.7.45.

    *) Bugfix: the "fastcgi_cache_min_uses" directive did not work.
       Thanks to Andrew Vorobyoff.
5923944e339711de2c4dc21659cc517f?d=identicon&s=25 Jb jb (icebofh)
on 2009-04-28 03:18
What are the -p and -s switches for ?

-J


Igor Sysoev wrote:

>
>     *) Feature: the -p switch.
>
>     *) Feature: the -s switch on Unix platforms.
>
>     *) Feature: the -? and -h switches.
>        Thanks to Jerome Loyet.
>
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2009-04-28 03:41
(Received via mailing list)
Hello!

On Tue, Apr 28, 2009 at 03:18:27AM +0200, Joe Bofh wrote:

> What are the -p and -s switches for ?

The -h switch should give you a clue:

$ nginx -h
nginx version: nginx/0.7.53
Usage: nginx [-?hvVt] [-s signal] [-c filename] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -s signal     : send signal to a master process: stop, quit, reopen,
reload
  -p prefix     : set prefix path (default: /usr/local/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)

Maxim Dounin
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-28 03:58
(Received via mailing list)
On Mon, Apr 27, 2009 at 6:32 PM, Maxim Dounin <mdounin@mdounin.ru>
wrote:

>  -s signal     : send signal to a master process: stop, quit, reopen, reload

so -s will find the master process somehow? does it use the pid file
defined in nginx.conf, or the default pid file location built in to
the  binary? or some other magic?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-28 06:39
(Received via mailing list)
On Mon, Apr 27, 2009 at 06:49:17PM -0700, Michael Shadle wrote:

> On Mon, Apr 27, 2009 at 6:32 PM, Maxim Dounin <mdounin@mdounin.ru> wrote:
>
> > š-s signal š š : send signal to a master process: stop, quit, reopen, reload
>
> so -s will find the master process somehow? does it use the pid file
> defined in nginx.conf, or the default pid file location built in to
> the  binary? or some other magic?

-s uses pid file defined in nginx.conf, if it's not defined, then
built-in.

So you may use
./nginx -s reload -c /path/to/nginx.conf
or
./nginx -s reload -p /path/to/nginx
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-28 07:04
(Received via mailing list)
what is the difference between "stop" and "quit"

i assume "reopen" is to reopen logfiles, and "reload" is graceful
reloading

you should add in a restart as well (forceful restart)

2009/4/27 Igor Sysoev <is@rambler-co.ru>:
> -s uses pid file defined in nginx.conf, if it's not defined, then built-in.
>
>

hat is th
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-28 07:27
(Received via mailing list)
On Mon, Apr 27, 2009 at 09:56:40PM -0700, Michael Shadle wrote:

> what is the difference between "stop" and "quit"

"stop" sends -TERM and nginx exits immediately.
"quit" sends -QUIT and nginx exits gracefully. Probably, it should
be called "shutdown".

> i assume "reopen" is to reopen logfiles, and "reload" is graceful reloading
>
> you should add in a restart as well (forceful restart)

I will think, I believe that restart is not good idea at all.
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-28 07:46
(Received via mailing list)
2009/4/27 Igor Sysoev <is@rambler-co.ru>:

> I will think, I believe that restart is not good idea at all.

Are there not special cases where it makes sense?

It would essentially be a -TERM and then a start (maybe after a brief
pause to clear any sockets/whatever is still open)
457ddcc7bbe653d02dd5964e53251d0e?d=identicon&s=25 Chris Wan (xi2008wang)
on 2009-04-28 08:40
Igor Sysoev wrote:
> Changes with nginx 0.7.53                                        27 Apr
> 2009
>
>     *) Change: now a log set by --error-log-path is created from the
> very
>        start-up.
> ...

could you add this feature: run nginx as a windows service?
5923944e339711de2c4dc21659cc517f?d=identicon&s=25 Jb jb (icebofh)
on 2009-04-28 09:31

Is there now a preferred way to install a new binary and restart nginx
given the new options available?


I just tried installing 0.7.53 and it appears the nginx init script does
not like restarting after a new binary has been installed.

So as of now, I have to do this

/etc/init.d/nginx stop
make install
/etc/init.d/nginx start



I'm open to hearing suggestions for minimizing downtime while upgrading.
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-28 09:48
(Received via mailing list)
i've always had to killall -9 nginx ; /etc/init.d/nginx start after a
recompile.

i did not have to stop nginx before make install though
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2009-04-28 10:33
(Received via mailing list)
Hello!

On Tue, Apr 28, 2009 at 09:31:46AM +0200, Joe Bofh wrote:

>
> /etc/init.d/nginx stop
> make install
> /etc/init.d/nginx start
>
>
> I'm open to hearing suggestions for minimizing downtime while upgrading.

If you want to minimize downtime - you should follow binary
upgrade procedure as described here:

http://wiki.nginx.org/NginxCommandLine

This gives you zero downtime (i.e. no single client request
missed).

Maxim Dounin
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-28 11:07
(Received via mailing list)
On Tue, Apr 28, 2009 at 08:40:13AM +0200, Chris Wan wrote:

> Igor Sysoev wrote:
> > Changes with nginx 0.7.53                                        27 Apr
> > 2009
> >
> >     *) Change: now a log set by --error-log-path is created from the
> > very
> >        start-up.
> > ...
>
> could you add this feature: run nginx as a windows service?

nginx will run as windows service in near future.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-28 11:07
(Received via mailing list)
On Tue, Apr 28, 2009 at 09:31:46AM +0200, Joe Bofh wrote:

> /etc/init.d/nginx start
>
> I'm open to hearing suggestions for minimizing downtime while upgrading.

make install
make upgrade

Look inside Makefile for details.
457ddcc7bbe653d02dd5964e53251d0e?d=identicon&s=25 Chris Wan (xi2008wang)
on 2009-04-28 11:19
Igor Sysoev wrote:
> On Tue, Apr 28, 2009 at 08:40:13AM +0200, Chris Wan wrote:
>
>> Igor Sysoev wrote:
>> > Changes with nginx 0.7.53                                        27 Apr
>> > 2009
>> >
>> >     *) Change: now a log set by --error-log-path is created from the
>> > very
>> >        start-up.
>> > ...
>>
>> could you add this feature: run nginx as a windows service?
>
> nginx will run as windows service in near future.

oh, I expect it .

I use instsrv.exe srvany.exe now and nginx can run as windows servece.
but, this command: nginx -s reload don't  work, I  shutdown and start it
only.
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-28 17:25
(Received via mailing list)
On Tue, Apr 28, 2009 at 1:23 AM, Maxim Dounin <mdounin@mdounin.ru>
wrote:

> If you want to minimize downtime - you should follow binary
> upgrade procedure as described here:
>
> http://wiki.nginx.org/NginxCommandLine
>
> This gives you zero downtime (i.e. no single client request
> missed).

interesting.

so find the master pid

kill -USR2 $pid
kill -WINCH $pid

Is all that is needed?
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-28 17:34
(Received via mailing list)
On Tue, Apr 28, 2009 at 08:16:01AM -0700, Michael Shadle wrote:

> interesting.
>
> so find the master pid
>
> kill -USR2 $pid
> kill -WINCH $pid
>
> Is all that is needed?

kill -WINCH $pid

decide keep the new binary or not, then

kill -QUIT $pid.oldbin

to keep, or

kill -TERM $pid

to rollback.
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-28 17:48
(Received via mailing list)
2009/4/28 Igor Sysoev <is@rambler-co.ru>:
>> > missed).
> kill -WINCH $pid
>
> decide keep the new binary or not, then
>
> kill -QUIT $pid.oldbin
>
> to keep, or
>
> kill -TERM $pid
>
> to rollback.

the wiki is out of date then. it says USR2 then WINCH. not WINCH then
QUIT.

So there is no USR2 required? I will update the wiki with these
instructions (is there a version this started in?)
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-28 17:55
(Received via mailing list)
On Tue, Apr 28, 2009 at 08:32:16AM -0700, Michael Shadle wrote:

> >> > This gives you zero downtime (i.e. no single client request
> >
> > to rollback.
>
> the wiki is out of date then. it says USR2 then WINCH. not WINCH then QUIT.
>
> So there is no USR2 required? I will update the wiki with these
> instructions (is there a version this started in?)

No, USR2 is required. WINCH is not necessary step.
You may use USR2, sleep 1, -f pid.oldbin, QUIT.
Look inside Makefile
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-28 23:19
(Received via mailing list)
Hi Igor,

since 0.7.48 and the fact that headers like Expires or Cache-Control
are take into account ... I'm not able to cache everything. If the
backend set a Expires header in the past, then the page is never
cached. Is there a way to make it work like this ?

Thanks
++ jerome

2009/4/28 Igor Sysoev <is@rambler-co.ru>:
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-29 02:17
(Received via mailing list)
Le 28 avril 2009 23:09, Jérôme Loyet <jerome@loyet.net> a écrit :
> Hi Igor,
>
> since 0.7.48 and the fact that headers like Expires or Cache-Control
> are take into account ... I'm not able to cache everything. If the
> backend set a Expires header in the past, then the page is never
> cached. Is there a way to make it work like this ?
>
> Thanks
> ++ jerome
>
Hi igor,

I made a patch which add two new directives:
proxy_cache_ignore_headers and fastcgi_cache_ignore_headers. By
default, they are set to off and everything works as before. When set
to on, pages are cached even if Expires or Cache-Control said not to.

I need to cache pages even if the backend said not to because I don't
have access to the backend code and no one can :(

The patch is attached. I've tested it with proxy but not with fastcgi.
As the patch is simple, it should not be a problem.

Hope it would help.

++ Jerome
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-29 06:31
(Received via mailing list)
On Wed, Apr 29, 2009 at 02:03:06AM +0200, J?r?me Loyet wrote:

> >
> The patch is attached. I've tested it with proxy but not with fastcgi.
> As the patch is simple, it should not be a problem.
>
> Hope it would help.

Thank you for the patch, however, I'm going to implement more generic
directive proxy/fastcgi_ignore_header to ignore as well
X-Accel-Redirect,
X-Accel-Expires, etc.
Fcaa940f447c1c76afb8ee2448ba0461?d=identicon&s=25 Jérôme Loyet (Guest)
on 2009-04-29 09:56
(Received via mailing list)
2009/4/29 Igor Sysoev <is@rambler-co.ru>:
>> > Thanks
>> have access to the backend code and no one can :(
>>
>> The patch is attached. I've tested it with proxy but not with fastcgi.
>> As the patch is simple, it should not be a problem.
>>
>> Hope it would help.
>
> Thank you for the patch, however, I'm going to implement more generic
> directive proxy/fastcgi_ignore_header to ignore as well X-Accel-Redirect,
> X-Accel-Expires, etc.

OK, I'll use my patch the time this feature is realeased. I juste
wanted to be sure that in the near future all my architecture with
nginx will still be valid :)

Thx a lot igor
++ Jerome
14eddebaded16496d1198b2e43d44946?d=identicon&s=25 Jauder Ho (jauderho)
on 2009-04-30 01:15
FWIW, I updated my init script for nginx to be able to do upgrades..

http://bit.ly/2j0aH

--Jauder




Michael Shadle wrote:

>
> the wiki is out of date then. it says USR2 then WINCH. not WINCH then
> QUIT.
>
> So there is no USR2 required? I will update the wiki with these
> instructions (is there a version this started in?)
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-30 02:45
(Received via mailing list)
you should add in the config file checks using-t like cliff has with
his redhat script (was it cliff?)

that's an awesome feature. if it fails config check it wont reload or
restart etc.
14eddebaded16496d1198b2e43d44946?d=identicon&s=25 Jauder Ho (jauderho)
on 2009-04-30 02:48
Do you have a link to this?


Michael Shadle wrote:
> you should add in the config file checks using-t like cliff has with
> his redhat script (was it cliff?)
>
> that's an awesome feature. if it fails config check it wont reload or
> restart etc.
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 Michael Shadle (Guest)
on 2009-04-30 03:15
(Received via mailing list)
basically this:
http://wiki.nginx.org/RedHatNginxInitScript

just adds an extra macro/function in there to do an nginx -t
$conffile, and adds it in appropriate places (reload, restart, start,
now upgrade as well)

also we had to add in a sleep inside of restart

restart() {
    configtest || return $?
    stop
    sleep 3
    start
}

however, i suppose depending on the signal that "stop" sends it could
be done a lot quicker (restart should force stop, which is the -QUIT i
believe?) we had issues where it seemed like sockets weren't cleaned
up fast enough or something.
This topic is locked and can not be replied to.