0

I have web socket GET requests that are coming to an Apache http sever and are being forwarded to a Apache Tomcat 8.5.x server (represented here as 192.168.1.77:80).

I'm attempting to use mod_headers to set the "upgrade" header value.

Inside my VirtualHost tag, I have the equivalent to the following:

<LocationMatch "/somewhere">
   ProxyPass ws://192.168.1.77:80/socket
   RequestHeader set Upgrade "myvalue"
</LocationMatch>

This does not work as I would expect it to. The set seems to be applying to Apache http but not Apache Tomcat.

In Apache http, when I add %{Upgrade}i to my LogFormat, I see the "Upgrade" header is set to "myvalue".

However, in the Tomcat logs, if I add *%{Upgrade}i", I see that my RequestHeader set operation did not take effect, and Tomcat records the original value for the "Upgrade" header in the original GET request.

Note: I have already tried adding the "early" argument like so:

<LocationMatch "/somewhere">
   ProxyPass ws://192.168.1.77:80
   RequestHeader set Upgrade "myvalue" early
</LocationMatch>

Any thoughts as to what is going wrong or what I might be missing?

Mark Nenadov
  • 6,421
  • 5
  • 24
  • 32

1 Answers1

0

I'm using mod_proxy_wstunnel, and apparently the upgrade header "WebSocket" is hard-coded in that module.

Mark Nenadov
  • 6,421
  • 5
  • 24
  • 32