I am trying to relay the WebSocket connection of V2Ray with Apache according to This post, and the snippet below worked before.

<LocationMatch "/{ws_path}}/">
    ProxyPass ws://{port}/{ws_path}/ upgrade=WebSocket
    ProxyAddHeaders Off
    ProxyPreserveHost On
    RequestHeader set Host %{HTTP_HOST}s
    RequestHeader set X-Forwarded-For %{REMOTE_ADDR}s

However now I wanted to replicate it on a new machine, Apache2 cannot be started, and the error message says:

Jun 13 11:22:22 localhost apachectl[1519]: AH00526: Syntax error on line 32 of /etc/apache2/sites-enabled/whc2001cloud.tk.conf:
Jun 13 11:22:22 localhost apachectl[1519]: ProxyPass unknown Worker parameter
Jun 13 11:22:22 localhost apachectl[1519]: Action 'start' failed.
Jun 13 11:22:22 localhost apachectl[1519]: The Apache error log may have more information.
Jun 13 11:22:22 localhost systemd[1]: apache2.service: Control process exited, code=exited status=1
Jun 13 11:22:22 localhost systemd[1]: Failed to start The Apache HTTP Server.

If I take away the upgrade=WebSocket parameter, Apache2 starts, but V2Ray is unable to make connection correctly. I have already enabled mod_ssl, mod_proxy, mod_proxy_wstunnel and other related modules.

  • are you using apache 2.2 or apache 2.4? – c4f4t0r Jun 13 '19 at 12:34
  • @c4f4t0r It's Apache 2.4.25. – whc2001 Jun 13 '19 at 12:55
  • @Wwhc2001 I think that you are using the parameter option in the wrong way httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html, in any case, from doc, it sould work without this parameter by default – c4f4t0r Jun 13 '19 at 13:32
  • 1
    @c4f4t0r Thanks, seems like it does work without that parameter. The connection failure is due to an invalid DNS record. – whc2001 Jun 13 '19 at 14:05

*Forgot to post the answer instead of commenting back then

Just remove the upgrade=WebSocket patameter and it should work without any problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.