Proxy_pass using commandbox

Hello,

I am working on migrating an site to use commandbox only and not using nginx.

Is there a way to do this in commandbox?

  location /socket.io/ {
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $host;

      proxy_pass http://IP-Address:3000;

      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
   }

I am aware of SocketBox but was hoping CommandBox/Undertow could handle the above.

Thanks!

Randy

I think I found what I am looking for here: Rule Examples | CommandBox : CLI, Package Manager, REPL & More

path-prefix('/reports') -> load-balanced-proxy({'http://reports1.mydomain.com','http://reports2.mydomain.com'})

and

proxy( 'http://localhost:8085' )

I was thinking perhaps this but it didn’t do anything

"rules" : ["path-prefix('/socket.io') ->proxy({'http://my-ip:3000'})"],

I"ll play more with it tomorrow.

This rule worked. I forgot to add the new server to the firewall rules

Sorry, I didn’t see this thread until now. Glad you got it working. Can you submit this as an example to the docs page? It seems useful. Rule Examples | CommandBox : CLI, Package Manager, REPL & More