Created
January 23, 2026 14:09
-
-
Save ciis0/580e3e210d51d89812a61ca9d00ec48e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 *:8443> | |
| ServerAlias *.my.localhost | |
| SSLCertificateFile _.my.localhost.pem | |
| SSLEngine On | |
| ProxyPreserveHost On | |
| RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME} | |
| RequestHeader set X-Forwarded-Port expr=%{SERVER_PORT} | |
| RewriteEngine On | |
| RewriteCond %{SERVER_NAME} "((.*)-)?(.*)-(.*)-(.*)-(.*).my.localhost" | |
| RewriteCond %{HTTP:Upgrade} !=websocket | |
| RewriteRule (.*) http://%3.%4.%5.%6:8080$1 [P,L] | |
| RewriteCond %{SERVER_NAME} "((.*)-)?(.*)-(.*)-(.*)-(.*).my.localhost" | |
| RewriteCond %{HTTP:Upgrade} =websocket | |
| RewriteRule (.*) ws://%3.%4.%5.%6:8080$1 [P,L] | |
| RewriteCond %{SERVER_NAME} "(.*).my.localhost" | |
| RewriteCond %{HTTP:Upgrade} !=websocket | |
| RewriteRule (.*) http://%1.wsl:8080$1 [P,L] | |
| RewriteCond %{SERVER_NAME} "(.*).my.localhost" | |
| RewriteCond %{HTTP:Upgrade} =websocket | |
| RewriteRule (.*) ws://%1.wsl:8080$1 [P,L] | |
| </VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment