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.
Igor S. (Guest)
on 2009-04-27 16: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 D..

    *) 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.
Jb j. (Guest)
on 2009-04-28 05:18
What are the -p and -s switches for ?

-J


Igor S. wrote:

>
>     *) Feature: the -p switch.
>
>     *) Feature: the -s switch on Unix platforms.
>
>     *) Feature: the -? and -h switches.
>        Thanks to Jerome Loyet.
>
Maxim D. (Guest)
on 2009-04-28 05: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 D.
Michael S. (Guest)
on 2009-04-28 05:58
(Received via mailing list)
On Mon, Apr 27, 2009 at 6:32 PM, Maxim D. <removed_email_address@domain.invalid>
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?
Igor S. (Guest)
on 2009-04-28 08:39
(Received via mailing list)
On Mon, Apr 27, 2009 at 06:49:17PM -0700, Michael S. wrote:

> On Mon, Apr 27, 2009 at 6:32 PM, Maxim D. <removed_email_address@domain.invalid> 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
Michael S. (Guest)
on 2009-04-28 09: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 S. <removed_email_address@domain.invalid>:
> -s uses pid file defined in nginx.conf, if it's not defined, then built-in.
>
>

hat is th
Igor S. (Guest)
on 2009-04-28 09:27
(Received via mailing list)
On Mon, Apr 27, 2009 at 09:56:40PM -0700, Michael S. 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.
Michael S. (Guest)
on 2009-04-28 09:46
(Received via mailing list)
2009/4/27 Igor S. <removed_email_address@domain.invalid>:

> 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)
Chris W. (Guest)
on 2009-04-28 10:40
Igor S. 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?
Jb j. (Guest)
on 2009-04-28 11: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.
Michael S. (Guest)
on 2009-04-28 11: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
Maxim D. (Guest)
on 2009-04-28 12: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 D.
Igor S. (Guest)
on 2009-04-28 13:07
(Received via mailing list)
On Tue, Apr 28, 2009 at 08:40:13AM +0200, Chris Wan wrote:

> Igor S. 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.
Igor S. (Guest)
on 2009-04-28 13: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.
Chris W. (Guest)
on 2009-04-28 13:19
Igor S. wrote:
> On Tue, Apr 28, 2009 at 08:40:13AM +0200, Chris Wan wrote:
>
>> Igor S. 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.
Michael S. (Guest)
on 2009-04-28 19:25
(Received via mailing list)
On Tue, Apr 28, 2009 at 1:23 AM, Maxim D. <removed_email_address@domain.invalid>
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?
Igor S. (Guest)
on 2009-04-28 19:34
(Received via mailing list)
On Tue, Apr 28, 2009 at 08:16:01AM -0700, Michael S. 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.
Michael S. (Guest)
on 2009-04-28 19:48
(Received via mailing list)
2009/4/28 Igor S. <removed_email_address@domain.invalid>:
>> > 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?)
Igor S. (Guest)
on 2009-04-28 19:55
(Received via mailing list)
On Tue, Apr 28, 2009 at 08:32:16AM -0700, Michael S. 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
Jérôme Loyet (Guest)
on 2009-04-29 01: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 S. <removed_email_address@domain.invalid>:
Jérôme Loyet (Guest)
on 2009-04-29 04:17
(Received via mailing list)
Attachment: patch.0.7.53.1.cache_ignore_headers (0 Bytes)
Le 28 avril 2009 23:09, Jérôme Loyet <removed_email_address@domain.invalid> 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
Igor S. (Guest)
on 2009-04-29 08: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.
Jérôme Loyet (Guest)
on 2009-04-29 11:56
(Received via mailing list)
2009/4/29 Igor S. <removed_email_address@domain.invalid>:
>> > 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
Jauder H. (Guest)
on 2009-04-30 03:15
FWIW, I updated my init script for nginx to be able to do upgrades..

http://bit.ly/2j0aH

--Jauder




Michael S. 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?)
Michael S. (Guest)
on 2009-04-30 04: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.
Jauder H. (Guest)
on 2009-04-30 04:48
Do you have a link to this?


Michael S. 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.
Michael S. (Guest)
on 2009-04-30 05: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.