首页 > 解决方案 > 共享网络空间上的邮袋服务器

问题描述

我将 PouchDB 用于 Web 应用程序。为了同步,我在本地安装了 PouchDB 服务器进行测试。不幸的是,我在 www 中没有自己的服务器,而只有一个共享的网络空间(使用 apache、SSH 连接和有限的 bash 命令)。
我可以在此安装和启动 pouch 服务器,但我无法从外部获得连接,因为 web 服务器只侦听端口 80,但 pouch 服务器在端口 5984 上运行。

邮袋服务器应可在以下位置访问:sub.domain.tdl/pouchserver

为此,我.htacces在此目录中创建了一个文件,其内容如下:

RewriteRule ^$ http://127.0.0.1:5984/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:5984/$1 [P,L]

调用:sub.domain.tdl:5984/pouchserver/_utils导致错误页面:Connection Failed

我的问题是,我可以通过重定向请求.htaccess以便将其发送到邮袋服务器吗?
如果是怎么办?

链接:https ://github.com/pouchdb/pouchdb-server#usage

编辑2:我发现了我的第一个错误。当然,我不被允许调用 5984 端口,或者那里没有答案我并不奇怪。
我想要的是来自浏览器端口 80 的请求.htaccess被重定向到端口 5984。
但是调用:sub.domain.tdl/pouchserver/_utils只会导致:The requested URL was not found on this server.

标签: apache.htaccesspouchdb

解决方案


推荐阅读