Created
May 28, 2019 09:49
-
-
Save codesorter2015/d7fe61072403a46e289b1ee0393dd0a1 to your computer and use it in GitHub Desktop.
Apache Proxy With Socket Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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