如何在.htaccess RewriteRule中使用UNIX套接字?

All*_*ter 5 apache .htaccess unix-socket

我想将来自Apache服务器的OS X机器上的一些请求使用.htaccess文件中的配置代理到在UNIX套接字上侦听的Node.js应用程序.如果需要澄清,我将在开发环境中使用它而非生产.

问题是,我不确定如何编写RewriteRule它,或者即使这是可能的.

当前.htaccess档案:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle WebSockets
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} ^/socket.io
    RewriteRule ^(.*)$ unix:/Users/xxx/xxx/nodejs.sock [P,L]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)

有一个node.js的应用程序监听此UNIX套接字,我可以看到该文件/Users/xxx/xxx/nodejs.sock=从终端(=符号只是应该指出,这是一个UNIX套接字我觉得呢?)./socket.io从浏览器访问路径时,我仍然看到index.php文件已执行.

我假设问题必须是UNIX socket的格式.