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