* bug#26547: services: add mime.types
@ 2017-04-17 21:20 Julien Lepiller
2017-04-18 8:38 ` Ludovic Courtès
2017-04-20 8:33 ` bug#26547: julien lepiller
0 siblings, 2 replies; 3+ messages in thread
From: Julien Lepiller @ 2017-04-17 21:20 UTC (permalink / raw)
To: 26547
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
Hi,
this patch adds a directive in the nginx configuration to include
nginx's mime.types file, which allows nginx to recognize the files.
Before that, files were served as application/octet-stream, which was
not recognized by the browser as a webpage.
[-- Attachment #2: 0001-services-nginx-Use-mime.types.patch --]
[-- Type: text/x-patch, Size: 2227 bytes --]
From 28a9d348ede5a88553308479a210ec2facce9c81 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Mon, 17 Apr 2017 23:06:04 +0200
Subject: [PATCH] services: nginx: Use mime.types.
* gnu/service/web.scm: Include mime.types in generated configuration.
---
gnu/services/web.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 11408d7b0..b7b2f67f1 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -180,7 +180,7 @@ of index files."
(nginx-upstream-configuration-servers upstream)))
" }\n"))
-(define (default-nginx-config log-directory run-directory server-list upstream-list)
+(define (default-nginx-config nginx log-directory run-directory server-list upstream-list)
(mixed-text-file "nginx.conf"
"user nginx nginx;\n"
"pid " run-directory "/pid;\n"
@@ -192,6 +192,7 @@ of index files."
" uwsgi_temp_path " run-directory "/uwsgi_temp;\n"
" scgi_temp_path " run-directory "/scgi_temp;\n"
" access_log " log-directory "/access.log;\n"
+ " include " nginx "/share/nginx/conf/mime.types;\n"
"\n"
(string-join
(filter (lambda (section) (not (null? section)))
@@ -235,7 +236,7 @@ of index files."
;; Check configuration file syntax.
(system* (string-append #$nginx "/sbin/nginx")
"-c" #$(or config-file
- (default-nginx-config log-directory
+ (default-nginx-config nginx log-directory
run-directory server-blocks upstream-blocks))
"-t")))))
@@ -250,7 +251,7 @@ of index files."
(zero?
(system* #$nginx-binary "-c"
#$(or config-file
- (default-nginx-config log-directory
+ (default-nginx-config nginx log-directory
run-directory server-blocks upstream-blocks))
#$@args))))))
--
2.12.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#26547: services: add mime.types
2017-04-17 21:20 bug#26547: services: add mime.types Julien Lepiller
@ 2017-04-18 8:38 ` Ludovic Courtès
2017-04-20 8:33 ` bug#26547: julien lepiller
1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2017-04-18 8:38 UTC (permalink / raw)
To: Julien Lepiller; +Cc: 26547
Hi Julien,
Julien Lepiller <julien@lepiller.eu> skribis:
> From 28a9d348ede5a88553308479a210ec2facce9c81 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Mon, 17 Apr 2017 23:06:04 +0200
> Subject: [PATCH] services: nginx: Use mime.types.
>
> * gnu/service/web.scm: Include mime.types in generated configuration.
More like:
* gnu/services/web.scm (default-nginx-config): Add 'nginx' parameter
and honor it. Adjust callers.
Otherwise LGTM, thanks!
(FWIW, I previously worked around it in an NGINX configured via a plain
text file by adding mime.types to /etc, like this:
<https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/bayfront.scm#n69>.)
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#26547:
2017-04-17 21:20 bug#26547: services: add mime.types Julien Lepiller
2017-04-18 8:38 ` Ludovic Courtès
@ 2017-04-20 8:33 ` julien lepiller
1 sibling, 0 replies; 3+ messages in thread
From: julien lepiller @ 2017-04-20 8:33 UTC (permalink / raw)
To: 26547-done
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-20 8:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-17 21:20 bug#26547: services: add mime.types Julien Lepiller
2017-04-18 8:38 ` Ludovic Courtès
2017-04-20 8:33 ` bug#26547: julien lepiller
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.