Skip to content

Instantly share code, notes, and snippets.

@Ghostscypher
Created September 7, 2021 12:28
Show Gist options
  • Save Ghostscypher/85f9991f02105d8462cfe647cf569e35 to your computer and use it in GitHub Desktop.
Save Ghostscypher/85f9991f02105d8462cfe647cf569e35 to your computer and use it in GitHub Desktop.
<VirtualHost _default_:443>
ServerName example.com
ServerAdmin [email protected]
DocumentRoot /var/www/public_html/example.com/public
<Directory /var/www/public_html/example.com>
AllowOverride All
</Directory>
### Our config starts here ###
ProxyPass "/app/" "ws://127.0.0.1:6000/app/"
ProxyPass "/apps/" "http://127.0.0.1:6000/apps/"
### Our config ends here ###
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# Add correct paths below for SSL support
#SSLEngine on
#SSLCertificateFile /path/to/cert.cer
#SSLCertificateKeyFile /path/to/cert.key
#SSLCertificateChainFile /path/to/fullchain.crt
#SSLCACertificateFile /path/to/ca.cer
#....
</VirtualHost>
@Temepest74
Copy link

I changed it. I still get the same issue :/.
This is what I found in error.log. I forgot to check it.

ip.1 - - [13/Jan/2022:19:25:36 +0200] "GET /app/code?protocol=7&client=js&version=7.0.3&flash=false HTTP/1.1" 502 411 "-" "X"
ip.2 - - [13/Jan/2022:19:26:07 +0200] "GET /app/code?protocol=7&client=js&version=7.0.3&flash=false HTTP/1.1" 502 411 "-" "X"

@Ghostscypher
Copy link
Author

@Temepest74 have you by any chance set up SSL on your websockets project i.e. the websockets.conf file if yes remove SSL certificates and restart the websockets server

@Temepest74
Copy link

@Ghostscypher , yes, this was the issue. You have my respect.

@monedicolombia
Copy link

Hi, I'm trying to use this same configuration on a Plesk server, as you may know Plesk uses Nginx and Apache, so I'm running the Laravel websockets server without any SSL configuration, but I'm receiving the following error "Status Code: 426 Upgrade header MUST be provided" I'm trying to make a websockets connection from Postman to "wss://website.com/app/ebf..." I know Postman is sending the proper headers but for some reason the websockets server is not receiving all the information? This error is driving me crazy please help.

@Ghostscypher
Copy link
Author

Hello @monedicolombia I believe your issue is rather from the server and not postman itself, if you'd like further help you can contact me on Gmail via [email protected], i'd be more than happy to help you resolve this issue as for now I can't exactly pinpoint where your configuration issue lies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment