aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/etc/nginx/conf.d
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-11-28 00:07:45 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2022-11-28 00:07:45 +0100
commitd9a71a04b1478e8ab1ec871b25c8bf043f3a85f7 (patch)
treecdff00c4240c4fbd70fd41a95de083cad87ae171 /etc/nginx/conf.d
parentadd LICENSE.txt (diff)
downloadwg-api-web-d9a71a04b1478e8ab1ec871b25c8bf043f3a85f7.tar.gz
wg-api-web-d9a71a04b1478e8ab1ec871b25c8bf043f3a85f7.zip
add a minimal working version
Diffstat (limited to 'etc/nginx/conf.d')
-rw-r--r--etc/nginx/conf.d/default.conf22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/nginx/conf.d/default.conf b/etc/nginx/conf.d/default.conf
new file mode 100644
index 0000000..176010f
--- /dev/null
+++ b/etc/nginx/conf.d/default.conf
@@ -0,0 +1,22 @@
+upstream backend {
+ server 192.168.177.1:1234;
+}
+
+server {
+ listen 80;
+ listen [::]:80;
+
+ root /usr/share/nginx/html;
+
+ location / {
+ index index.html;
+ }
+
+ location ~ ^/api/(?<rpc_method>ListPeers|GetDeviceInfo)$ {
+ proxy_set_header Content-Type application/json;
+ proxy_set_header Referer "";
+ proxy_method POST;
+ proxy_set_body '{"jsonrpc": "2.0", "method": "$rpc_method", "params": {}}';
+ proxy_pass http://backend;
+ }
+}