Multiple Sites

Multiple Sites

Isso is designed to serve comments for a single website and therefore stores comments for a relative URL. This is done to support HTTP, HTTPS and even domain transfers without manual intervention. You can chain Isso to support multiple websites on different domains.

以下示例将 gunicorn 用作WSGI服务器(您也可以使用uWSGI)。假设您维护两个网站,例如foo.example和other.bar:

$ cat /etc/isso.d/foo.example.cfg
[general]
name = foo
host = http://foo.example/
dbpath = /var/lib/isso/foo.example.db

$ cat /etc/isso.d/other.bar.cfg
[general]
name = bar
host = http://other.bar/
dbpath = /var/lib/isso/other.bar.db

然后,您用gunicorn运行Isso(用分号分隔多个配置文件):

$ export ISSO_SETTINGS="/etc/isso.d/foo.example.cfg;/etc/isso.d/other.bar.cfg"
$ gunicorn isso.dispatch -b localhost:8080

在您的Web服务器配置中,照常代理Isso:

server {
    listen [::]:80;
    server_name comments.example;

    location / {
        proxy_pass http://localhost:8080;
    }
}

现在,当您访问http://comments.example/时,您会看到不同的Isso配置,以 /name 分隔。

$ curl http://comments.example/
/foo
/bar

只需嵌入包含新的相对路径的JavaScript,例如 http://comments.example/foo/js/embed.min.js 。确保不要在两个站点上混合使用URL,因为这很可能会导致与CORS相关的错误。