Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codesorter2015/d7fe61072403a46e289b1ee0393dd0a1 to your computer and use it in GitHub Desktop.
Save codesorter2015/d7fe61072403a46e289b1ee0393dd0a1 to your computer and use it in GitHub Desktop.
Apache Proxy With Socket Setup
<VirtualHost *:80>
ServerName test.localhost
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
RewriteEngine On
RewriteCond %{HTTP:Connection} Upgrade [NC]
RewriteRule /(.*) ws://localhost:3001/$1 [P,L]
ProxyPass /socket.io http://localhost:3001/socket.io retry=0 timeout=5
ProxyPassReverse /socket.io http://localhost:3001/socket.io
RewriteCond %{HTTP_REFERER} ^(?:[:\/\/-A-Za-z0-9])+[A-Za-z]{2,6}+\/cache.*
RewriteRule /(.*) http://localhost:3001/$1 [P,L]
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment