- Newest
- Most votes
- Most comments
You might want to enable access (request) logging for the ALB: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html
The "request" field in the log (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html#access-log-entry-syntax) would show exactly what query string parameters the ALB reports it's received when the request routing isn't working in the expected way.
You can use Athena to query the access logs conveniently: https://docs.aws.amazon.com/athena/latest/ug/application-load-balancer-logs.html
The issue you're experiencing with ALB query string routing for websockets in the context of Unreal Engine Pixel Streaming is likely related to the specific requirements of websocket connections and how they interact with ALB routing rules.
For Unreal Engine Pixel Streaming, which relies heavily on websocket connections, a more specialized approach is typically needed when using an Application Load Balancer (ALB). The standard query string-based routing might not be sufficient for maintaining the websocket connection properly.
Instead of using query string-based routing, a recommended approach for Pixel Streaming with ALB is to use a combination of AWS Lambda functions and Amazon EventBridge to manage the routing of websocket connections. This method involves:
- Using AWS Lambda to register the signaling servers to an ALB target group.
- Creating a unique query string for each signaling server when it's registered to the ALB target group.
- Using an ALB listener rule that allows accessing a specific signaling server based on this unique query string.
- Employing another AWS Lambda function to relay the correct query string to the user via a WebSocket connection, ensuring the user is directed to the designated signaling server for their session.
This approach allows for more dynamic and precise routing of websocket connections, which is crucial for the proper functioning of Pixel Streaming.
The reason your setup works when you set the default action to forward to the target group with the working EC2 instance is that it bypasses the need for specific routing rules. However, this solution doesn't scale well for multiple instances or provide the level of control needed for a production Pixel Streaming deployment.
To resolve your issue, consider implementing the more complex but robust solution using Lambda functions and EventBridge for managing your signaling servers and routing websocket connections. This will provide a more reliable and scalable setup for Unreal Engine Pixel Streaming on AWS.
Sources
Deploy Unreal Engines Pixel Streaming at scale on AWS | AWS for Games Blog
answered 2 years ago
Just to clarify certain points that the GenAI wrote
The issue I am having is that query string routing is not working at all for websockets, but when I run an apache server, it works. The default rule that forwards to target group for websockets is working, but when the target group that was working in default is set to a rule with query string conditions it won't work
So I am trying to figure out why that is the issue.

Thank you for the reply.
I've checked the logs and webserver and managed to pinpoint the issue. The Query string routing is actually correct and it runs the html, however the javascript inside the HTML <script defer="defer" src="player.js"></script> is returning an error 503 when I try to access it
However, if I have a valid Target Group set to my default, it will work by using the player.js inside the default Target Group's EC2 instead of its own player.js
Is there any way I can fix this?
Sorry for the double comment.
the error 503 is Failed to load resource.