diff --git a/docs/README.md b/docs/README.md index 1f430e2e..45989f1a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,6 @@ # Documentation and FAQ - [How to configure remark42 with nginx reverse proxy](nginx-proxy.md) -- [How to configure remark42 without a subdomain](subdomain.md) +- [How to configure remark42 without a subdomain](subdomain.md) with Nginx or Caddy - [Telegram notifications](telegram.md) - [Setup email authentication and\or email notifications](email.md) - diff --git a/docs/subdomain.md b/docs/subdomain.md index cb63a404..5f7cb54b 100644 --- a/docs/subdomain.md +++ b/docs/subdomain.md @@ -2,7 +2,45 @@ All README examples show configurations with remark42 on its own subdomain, i.e. `https://remark42.example.com`. However, it is possible and sometimes desirable to run remark42 without a subdomain, but just under some path, i.e. `https://example.com/remark42`. -- The nginx.conf would then look something like: +- The frontend URL looks like this: `s.src = 'https://example.com/remark42/web/embed.js;` + +- The backend `REMARK_URL` parameter will be `https://example.com/remark42` + +- And you also need to slightly modify the callback URL for the social media login API's: + - Facebook Valid OAuth Redirect URIs: `https://example.com/remark42/auth/facebook/callback` + - Google Authorized redirect URIs: `https://example.com/remark42/auth/google/callback` + - Github Authorised callback URL: `https://example.com/remark42/auth/github/callback` + +### docker-compose configuration + +Both Nginx and Caddy configuration below relies on remark42 available on hostname `remark42`, which is achieved by having `container_name: remark42` in docker-compose. + +Example `docker-compose.yaml`: + +```yaml +version: '2' +services: + remark42: + image: umputun/remark42:latest + container_name: remark42 + restart: always + environment: + - REMARK_URL=https://example.com/remark42/ + - SITE= + - SECRET= + - ADMIN_SHARED_ID= + volumes: + - ./data:/srv/var + logging: + options: + max-size: "10m" + max-file: "1" +``` + +### Nginx configuration + +The `nginx.conf` would then look something like: + ``` location /remark42/ { rewrite /remark42/(.*) /$1 break; @@ -14,12 +52,22 @@ All README examples show configurations with remark42 on its own subdomain, i.e. } ``` -- The frontend URL looks like this: `s.src = 'https://example.com/remark42/web/embed.js;` +### Caddy configuration -- The backend `REMARK_URL` parameter will be `https://example.com/remark42` +Example of Caddy configuration (`Caddyfile`) running remark42 service on `example.com/remark42/`: -- And you also need to slightly modify the callback URL for the social media login API's: - - Facebook Valid OAuth Redirect URIs: `https://example.com/remark42/auth/facebook/callback` - - Google Authorized redirect URIs: `https://example.com/remark42/auth/google/callback` - - Github Authorised callback URL: `https://example.com/remark42/auth/github/callback` - \ No newline at end of file +```caddy +example.com { + gzip + tls mail@example.com + + root /srv/www + log /logs/access.log + + # remark42 + proxy /remark42/ http://remark42:8080/ { + without /remark42 + transparent + } +} +```