我试图通过nodejs和jsmpeg在uberspace之间传输视频数据。
我的问题是,当我试图访问url时,我得到了404:
The requested URL /receive was not found on this server.
我访问的url是这样的:https://stream.mydomain.com/receive
这是我的.htaccess:
DirectoryIndex disabled
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^send/(.*) http://localhost:61624/$1
RewriteRule ^receive/(.*) ws://localhost:61625/$1
</IfModule>发布于 2018-10-24 12:51:13
这里有两件事。
1)此规则RewriteRule ^receive/(.*) ws://localhost:61625/$1在/receive/xxx上匹配receive后的尾随斜杠(xxx部件作为可选部分)。因此,在您的情况下,您至少需要访问/receive/。这是你所期望的吗?如果没有,只需调整你的规则。
2)这两种规则都需要使用mod_proxy (使用P标志)
RewriteRule ^send/(.*)$ http://localhost:61624/$1 [P]
RewriteRule ^receive/(.*)$ ws://localhost:61625/$1 [P]不过,请注意,这个方法不是最快的。如果可能,在apache中使用ProxyPass和ProxyPassReverse,而不是htaccess。
https://stackoverflow.com/questions/52892204
复制相似问题