nginx and redis as pastebin

requirement : redis nginx lua snippets nginx access_by_lua_block { local redis = require "resty.redis" local red = redis:new() red:set_timeout(1000) -- 1 sec local ok, err = red:connect("127.0.0.1", 6379,"pool_size=128") if not ok then ngx.exit(503) return end local key = ngx.var.uri local method = ngx.var.request_method if method == "POST" or method == "PUT" then -- local set value = ngx ngx.req.read_body() local data = ngx.req.get_body_data() red:set(key,data) ngx.say("ok") return end if method == "GET" then local res, err = red:get(key) if res ~= ngx....

13 juillet 2022 · 1 min

Simple pastebin : Pinnwand

Simple Dockerfile to build pinnwand. https://pinnwand.readthedocs.io/en/latest/index.html FROM alpine RUN apk update && apk add py3-pip gcc python3-dev musl-dev g++ RUN pip3 install pinnwand EXPOSE 9000 CMD pinnwand http --port 9000

7 avril 2022 · 1 min