Giter Club home page Giter Club logo

Comments (6)

maddox avatar maddox commented on June 18, 2024

I personally do this with nginx. I have all my stuff behind an nginx proxy.

from harmony-api.

khaimov avatar khaimov commented on June 18, 2024

@maddox thanks for the superfast response, I have this running on Raspberry Pi, and I guess I can install nginx and reverse proxy into it. What would the Rest Call look like then? I would like to use IFTTT Maker to trigger a call to Harmony-API.

from harmony-api.

maddox avatar maddox commented on June 18, 2024

Oh, all i'm doing is BLOCKING traffic from outside the network.

from harmony-api.

khaimov avatar khaimov commented on June 18, 2024

@maddox I appreciate the response anyway. I think I will use an API Gateway, something like Kong, so this way I can securely broker communication via DMZ.

from harmony-api.

xac1d avatar xac1d commented on June 18, 2024

anyone mind sharing their nginx config for this? i have it kinda working but i'm missing something.

from harmony-api.

maddox avatar maddox commented on June 18, 2024

Here's my config. I'm using nginx as a proxy, and I'm securing it by blocking it outside of of my local network.

# --- + PROXY + ---

# Template variables:
#
# * domain = harmony.domain.com
# * name = harmony
# * type = proxy
# * host = localhost
# * port = 8282

upstream harmony-lb {
    server localhost:8282;
}

server {
   listen 80;
   server_name harmony.domain.com;
   return 301 https://harmony.domain.com$request_uri;
}

server {
    server_name harmony.domain.com;
    listen 443 ssl;


    location / {
        allow 192.168.1.1/24;
        allow 127.0.0.1;
        deny all;

        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_pass http://harmony-lb;
    }

    ssl_certificate /etc/letsencrypt/live/harmony.domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/harmony.domain.com/privkey.pem;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";

    access_log /var/log/nginx/harmony-access.log;
    error_log  /var/log/nginx/harmony-error.log;
}

# --- - PROXY - ---

Here's the security parts:

        allow 192.168.1.1/24;
        allow 127.0.0.1;
        deny all;

from harmony-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.