1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gotify_ynh.git synced 2024-09-03 20:36:26 +02:00
This commit is contained in:
yalh76 2022-10-05 23:00:39 +02:00
parent 6cc443416f
commit 653ff704e8

View file

@ -12,6 +12,30 @@ location __PATH__/stream {
proxy_read_timeout 7m;
}
location __PATH__/UP {
access_by_lua_block{
local json=require("cjson")
ngx.req.read_body()
local req = ngx.req.get_body_data()
local newreq = { ["message"] = req }
local body = json.encode(newreq)
ngx.req.set_body_data(body)
}
if ($request_method = GET ) {
return 200 '{"unifiedpush":{"version":1}}';
}
proxy_set_header Content-Type application/json;
proxy_pass http://127.0.0.1:__PORT__/message;
proxy_set_header Host $host;
# Force https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
}
location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__/;
#sub_path_only rewrite ^/__PATH__(/.*) $1 break;