Let's Encrypt를 사용하고 리버스 프록시 없이 멀티사이트 구성 설정하기

You likely need to change just the part having to do with the certificates.

Oh. Wait.

It sounds like recent changes to the way that the NGINX configuration is managed that this bit is now in a different file:

   # do not redirect all hosts back to the main domain name
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /if \(\$http_host[^\}]*\}/m
        to: ""

Yes. Here’s the new place:

I think that changing that filename to /etc/nginx/conf.d/outlets/server/20-https.conf will solve the redirect problem. You’ll also need to make the changes about how the certificate is requested, though if it’s working, I guess you might not need to change it.

2개의 좋아요

Thanks @pfaffman! Can’t get it working so far. Though I probably just ran into the Certificate limit as well, re-building with changes to the config file…

Gonna study the proxy stuff now :sob:

1개의 좋아요

If you did, you can just add another subdomain to the list (and the DNS record) and you’ll start a new rate limit.

2개의 좋아요

Maybe I was just duped again by the browser cache :face_with_spiral_eyes: In any case, I switched that server to the default multisite setup, with caddy as reverse proxy. In the end it’s also straightforward and one thing I actually like is that the certificates are for each domain then (and not all domains shared on one certificate).

Have another server to update, I’ll try the adjustments another time with that one to see what’s necessary..

Thanks again!

2개의 좋아요

데이터베이스에는 for 루프를 사용하는 것이 더 좋다고 생각합니다. 코드가 훨씬 깔끔해집니다.

hooks:
  after_postgres:
    - exec: |
        for db in two_db thirdsite_db; do
          sudo -u postgres createdb "$db" || true
          sudo -u postgres psql "$db" -c "grant all privileges on database $db to discourse;"
          sudo -u postgres psql "$db" -c "alter schema public owner to discourse;"
          sudo -u postgres psql "$db" -c "create extension if not exists hstore;"
          sudo -u postgres psql "$db" -c "create extension if not exists pg_trgm;"
        done
1개의 좋아요