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

    DWC2 and nginx reverse proxy - cont.

    Scheduled Pinned Locked Moved Unsolved
    Duet Web Control
    2
    3
    235
    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.
    • Nxt-1undefined
      Nxt-1
      last edited by

      I have decided it is time to pick up my reverse proxy endavours where I left them at the end of these threads 1 and 2.

      The end goal is to have mydomain.com/dwc lead to well... dwc. A number of other locations are also defined in the same reverse proxy, doing various things. On the forum I have seen others using a catch all location block (ie. location / { } ) for this purpose. While this config works for me, is leaves out the /dwc part of what I want.

      In the config below I started to experiment with adding locations for all the missing paths, but this cannot the way to go. Anyone more experienced that can explain to me how I can achieve what I want?

      mydomain.conf

      [...]
      location /dwc/ {
      	include /etc/nginx/proxy_params;
      	client_max_body_size 0;										# Don't limit upload size and pass it on immediately without buffering
      	proxy_http_version 1.1;										# WebSockets need explicid http 1.1
      	proxy_set_header Upgrade $http_upgrade;						# Make nginx treat this as a WebSocket
      	proxy_set_header Connection "upgrade";						# Make nginx treat this as a WebSocket
      
      	proxy_pass http://websocket;
          }
      
          location /css/app.0b5b36ba.css {
      	proxy_pass http://websocket;
          }
      
          location /js/app.cc04b2b3.js {
      	proxy_pass http://websocket;
          }
      [...]
      

      nginx.conf:

      [...]
      map $http_upgrade $connection_upgrade {
              	default upgrade;
              	'' close;
          	}
       
          	upstream websocket {
              	server 192.168.1.55;
          	}
      [...]
      

      Duet3D and delta printer enthousiast. Buildlog
      Looking for Duet3D configuration support, check out Nxt-3D

      1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators
        last edited by chrishamm

        I don't think it's a nice solution to redirect static DWC2 resources. You may be better of building DWC2 with publicPath set to /dwc instead of / in your case. This will create a new bundle that loads DWC2-related files from /dwc instead of /.

        Duet software engineer

        Nxt-1undefined 1 Reply Last reply Reply Quote 0
        • Nxt-1undefined
          Nxt-1 @chrishamm
          last edited by

          @chrishamm said in DWC2 and nginx reverse proxy - cont.:

          I don't think it's a nice solution to redirect static DWC2 resources. You may be better of building DWC2 with publicPath set to /dwc instead of / in your case. This will create a new bundle that loads DWC2-related files from /dwc instead of /.

          I agree it is not a nice solution, or even a solution at all. While rebuilding DWC2 custom for me, will most likely work, and I have though about it as well. I am not a fan of having to build firmware myself each time an update comes around. Unless I can convince you the publicPath should be set to /dwc by default 😉 .

          Duet3D and delta printer enthousiast. Buildlog
          Looking for Duet3D configuration support, check out Nxt-3D

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