• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Use Nginx with mango as an SSL reverse proxy

    How-To
    2
    3
    911
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MattFoxM
      MattFox
      last edited by MattFox

      NOTE: This assumes you can reach the mango box by port 80 and 443

      Otherwise a DNS challenge approach will be needed

      1. Inside mango env.properties file, ensure you have:
      • Set this to true if you are running Mango behind a reverse proxy that sends "Forwarded" or "X-Forwarded-*" headers.
      • This includes accessing Mango via Cloud Connect module. By default only requests from localhost are trusted.
      web.forwardedHeaders.enabled=true
      
      • Set a comma separated list of IP ranges from which to trust Forwarded headers
      web.forwardedHeaders.trustedIpRanges=127.0.0.0/8,::1
      
      1. Assuming you have nginx installed and certbot along with certbot nginx support.
        copy and rename the "your.website.com script below" file into
        /etc/nginx/sites-available/
        Open the file with nano and replace the instances of your.website.com with the actual domain name you are using (this file assumes you are running mango on port 8080!)
      2. cd into sites-enabled:
        cd ../sites-enabled
      3. as root, create a soft link with:
        ln -s ../sites-available/your.website.com
      4. restart nginx, you should then be able to access the website with straight http
      5. run certbot --nginx
      6. fill in credentials, at the option for https redirection, select 2
      7. press enter
      8. profit
      server {
      #your.website.com/
      
      server_name your.website.com;
      root /opt/mango/overrides/web/;
      index index.html; 
      
      location / {
      proxy_pass http://127.0.0.1:8080/;
      proxy_http_version 1.1; 
      
      # Inform Mango about the real host, port and protocol
      
      proxy_set_header X-Forwarded-Host $host:$server_port;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      }
      
       listen 80;
      }
      

      Fox

      Do not follow where the path may lead; go instead where there is no path.
      And leave a trail - Muriel Strode

      T 1 Reply Last reply Reply Quote 1
      • MattFoxM MattFox referenced this topic on
      • T
        tungthanh500 @MattFox
        last edited by

        @MattFox Hi Matt, Thank you for your post. I haven't tried your post yet but I already something similar. Could you try:
        Step 1: create a <ma-point-value> with enable-popup="left" (can be right or any direction).
        Step 2: click on the popup and see the chart.

        Mine didn't have chart shown up if I connect with my domain, but still work if connect with IP. I use VPS with public IP.

        MattFoxM 1 Reply Last reply Reply Quote 0
        • MattFoxM
          MattFox @tungthanh500
          last edited by

          @tungthanh500 sounds websocket related, can you look at the console and see what errors appear when you try to do the steps you mentioned before?

          Fox

          Do not follow where the path may lead; go instead where there is no path.
          And leave a trail - Muriel Strode

          1 Reply Last reply Reply Quote 0
          • MattFoxM MattFox referenced this topic on
          • First post
            Last post