From f119d199063a78c142525624a162f56d31447cb0 Mon Sep 17 00:00:00 2001 From: krumel Date: Sun, 27 Feb 2022 18:46:08 +0100 Subject: [PATCH] . --- playbooks/templates/scan_image.conf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/playbooks/templates/scan_image.conf b/playbooks/templates/scan_image.conf index ecd16ee..8910623 100644 --- a/playbooks/templates/scan_image.conf +++ b/playbooks/templates/scan_image.conf @@ -1,4 +1,4 @@ -erver { +server { listen 80; listen [::]:80; @@ -7,13 +7,15 @@ erver { location /scan { content_by_lua_block { - os.execute("scanimage --format jpeg >/srv/scans/image.jpg") - ngx.redirect("/scan/image.jpg") + epoc = ngx.time(); + os.execute("scanimage --format jpeg >/srv/scans/image"..epoc..".jpg"); + ngx.redirect("/scans/image"..epoc..".jpg"); } } - location /scan/image.jpg { - alias /srv/scans/image.jpg; + location /scans { + autoindex on; + root /srv/; } } \ No newline at end of file