Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    DuetWebServer Nginx proxy issues

    Scheduled Pinned Locked Moved
    General Discussion
    1
    1
    113
    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.
    • keyz182undefined
      keyz182
      last edited by

      I'm trying to get DuetWebServer (on a Pi4) running behind an Nginx proxy.

      It kind of works - I see what's going on, but it seems to be entirely read-only.

      If I try to upload a file, I get "index.js:220 Error: Operation failed (Reason: )" with a 400 error returned on the PUT (with no error message/no content).

      Same with POSTs when trying to execute/do anything - e.g. POST to http://<snip>/machine/code returns a 400 with no content.

      My nginx config is

      map $http_upgrade $connection_upgrade {
          default upgrade;
          '' close;
      }
      
      upstream dws {
          server 127.0.0.1:8080;
      }
      
      server {
          listen        80;
          server_name   <snip>;
          location / {
              proxy_pass         http://dws;
              proxy_http_version 1.1;
              proxy_set_header   Upgrade $http_upgrade;
              proxy_set_header   Connection "Upgrade";
              proxy_set_header   Host $host;
              proxy_cache_bypass $http_upgrade;
              proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header   X-Forwarded-Proto $scheme;
          }
      }
      

      And my /opt/dsf/conf/http.json is

      {
        "Logging": {
          "LogLevel": {
            "Default": "Information"
          }
        },
        "Kestrel": {
          "Endpoints": {
            "Http": {
              "Url": "http://*:8080"
            }
          }
        },
        "KeepAliveInterval": 30,
        "ModelRetryDelay": 5000,
        "UseStaticFiles": true,
        "DefaultWebDirectory": "/opt/dsf/sd/www",
        "MaxAge": 3600,
        "SocketPath": "/var/run/dsf/dcs.sock",
        "WebSocketBufferSize": 8192
      }
      

      I think my issue lies in the Nginx config, as I don't see any logging triggered by the request in the DWS logs (logs appear fine if I go to port 8080), but I'm not 100% sure.

      Has anyone else successfully done this?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA