Display configuration at runtime?

Jim Ohlstein jim at ohlste.in
Mon Apr 16 22:25:44 UTC 2012


On Apr 16, 2012 6:03 PM, "michael_teter" <nginx-forum at nginx.us> wrote:
>
> Thanks for the quick response.  My error log shows nothing, but my
> access log does show the visit.

Use higher level error logging. See
http://nginx.org/en/docs/ngx_core_module.html#error_log.

>
> Here's the relevant part of my config:
>
>
>   server {
>      listen      80;
>      server_name www.ourname.com;
>      rewrite     ^(.*)  https://$server_name$1 permanent;
>   }
>   server {
>      listen 443;
>      server_name www.ourname.com;
>      #try_files $uri /maintenance.html @passenger;

Why are you not using this line? It's the perfect use case for "try_files".
Note that I believe that you should remove the leading "/" from
"/maintenance.html".

>      root /home/michael/ourname/public;
>
>      # MT added 20120416
>      error_page 503 /maintenance.html;
>      if (-f $document_root/../tmp/stop.txt) {
>        set $maintenance 1;
>      }
>
>      if ($maintenance) {
>        return 503;
>      }

This is a lot more work than using the above "try_files". See also
http://wiki.nginx.org/IfIsEvil.

>
>      passenger_enabled on;
>      #rails_env development;
>      rails_env production;
>      location @passenger {
>        passenger_enabled on;
>        root /home/michael/ourname/public;
>      }
>
>      ssl on;
>      ssl_certificate /home/michael/ssl_keys/ourname.com_ssl.crt;
>      ssl_certificate_key /home/michael/ssl_keys/Cert1.key;
>      #return 403;
>   }
>
> Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,225392,225395#msg-225395
>
>

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120416/6ec30bb2/attachment.html>


More information about the nginx mailing list