From a623ced44837979330376209914bc18521e3550c Mon Sep 17 00:00:00 2001 From: got3nks Date: Sun, 9 Oct 2022 11:53:42 +0200 Subject: [PATCH] Nginx reverse proxy configuration You can use this configuration to create a reverse proxy to the DDNS REST API, protected by SSL. As a bonus it will add the remote IP address to the query string passed to the API. --- extra/nginx.conf | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 extra/nginx.conf diff --git a/extra/nginx.conf b/extra/nginx.conf new file mode 100644 index 0000000..c7b1713 --- /dev/null +++ b/extra/nginx.conf @@ -0,0 +1,22 @@ +# this configuration is a SSL reverse proxy to the DDNS REST API +# bonus: it will automatically append the IP of the remote client to the query string passed to the API + +server { + listen 8081 ssl; + listen [::]:8081 ssl; + server_name ns.domain.ltd; # update accordingly + + include snippets/self-signed.conf; # you will have to configure SSL certificates + + access_log /var/log/nginx/dyndns-access.log; + error_log /var/log/nginx/dyndns-error.log; + + location / { + set $delimeter ""; + if ($is_args) { + set $delimeter "&"; + } + set $args "$args${delimeter}addr=$remote_addr"; + proxy_pass http://127.0.0.1:8080$uri$is_args$args; + } +}