GNU bug report logs - #28560
[PATCH] web: Add try-files for the nginx-service-type.

Previous Next

Package: guix-patches;

Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>

Date: Sat, 23 Sep 2017 00:39:01 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 28560 <at> debbugs.gnu.org (full text, mbox):

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: 28560 <at> debbugs.gnu.org
Subject: Re: [bug#28560] [PATCH] web: Add try-files for the nginx-service-type.
Date: Sun, 24 Sep 2017 01:13:12 +0300
[Message part 1 (text/plain, inline)]
OK, I hacked little bit.  Here is a snippet of Nginx service in system
declaration and produced Nginx config from system build.

--8<---------------cut here---------------start------------->8---
(define %cgit-configuration-nginx
  (list
   (nginx-server-configuration
    (root cgit)
    (locations
     (list
      (nginx-location-configuration
       (uri "@cgit")
       (body '("fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;"
               "fastcgi_param PATH_INFO $uri;"
               "fastcgi_param QUERY_STRING $args;"
               "fastcgi_param HTTP_HOST $server_name;"
               "fastcgi_pass 127.0.0.1:9000;")))))
    (try-files (list "$uri" "@cgit"))
    (http-port 19418)
    (https-port #f)
    (ssl-certificate #f)
    (ssl-certificate-key #f))))

(operating-system
  …
  (services (cons* …
                   (service nginx-service-type)
                   (service fcgiwrap-service-type)
                   (service cgit-service-type
                            (cgit-configuration
                             (nginx %cgit-configuration-nginx)))
                   …)))
--8<---------------cut here---------------end--------------->8---

/gnu/store/pv4kna4526cijzpd6my69ikdb5qzb93m-nginx.conf
--8<---------------cut here---------------start------------->8---
user nginx nginx;
pid /var/run/nginx/pid;
error_log /var/log/nginx/error.log info;
http {
    client_body_temp_path /var/run/nginx/client_body_temp;
    proxy_temp_path /var/run/nginx/proxy_temp;
    fastcgi_temp_path /var/run/nginx/fastcgi_temp;
    uwsgi_temp_path /var/run/nginx/uwsgi_temp;
    scgi_temp_path /var/run/nginx/scgi_temp;
    access_log /var/log/nginx/access.log;
    include /gnu/store/vyj2vkmdmlpxn3mnj71vz8zc8j30ahkf-nginx-1.12.1/share/nginx/conf/mime.types;

    server {
      listen 19418;
      server_name _ ;
      root /gnu/store/b4zg0sz6z1n32qnwmgmbbwh78i55hr56-cgit-1.1;
      index index.html ;
      try_files $uri @cgit ;
      server_tokens off;

      location @cgit {
        fastcgi_param SCRIPT_FILENAME $document_root/lib/cgit/cgit.cgi;
        fastcgi_param PATH_INFO $uri;
        fastcgi_param QUERY_STRING $args;
        fastcgi_param HTTP_HOST $server_name;
        fastcgi_pass 127.0.0.1:9000;
      }

    }
}
events {}
--8<---------------cut here---------------end--------------->8---

[0001-web-Add-try-files-for-the-nginx-service-type.patch (text/x-patch, attachment)]

This bug report was last modified 7 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.