Publish to DigitalOcean Droplet

Things I have tried

I have read the docs on “Set up a custom domain” but I still don’t see the information that I need. I do not think the directions for “Set up using a proxy” are applicable to Traefik. The CloudFlare directions seem appropriate but AFAIK DigitalOcean does not have “Page Rules”.

What I’m trying to do

I have an Obsidian Publish subscription and I would like to setup a custom domain on my DigitalOcean Droplet (notes.mysite.com). I already have Traefik reverse proxy working with several other subdomains.

Any advice would be appreciated.

Well, nobody seemed to know the answer. I was able to get it working so I thought I would share the solution. The example using nginx.conf does not work.

Here is a solution for Traefik 2.8:

version: '3'
services:
    web:
        build: .
        image: richarvey/nginx-php-fpm:latest
        container_name: php_nginx
        restart: always
        labels:
            traefik.enable: "true"
            traefik.frontend.rule: "Host:notes.example.com"
            traefik.port: "80"

            # traefik.http.routers.nginx.entrypoints: "websecure"
            traefik.http.routers.nginx.rule: "Host(`notes.example.com`)"
            traefik.http.routers.nginx.tls: "true"

            traefik.frontend.entryPoints: "web,websecure"
            traefik.frontend.headers.SSLRedirect: "true"
            traefik.frontend.passHostHeader: "true"

            traefik.http.middlewares.test-redirectregex.redirectregex.regex: "^https://notes.example.com"
            traefik.http.routers.nginx.middlewares: "test-redirectregex"
            traefik.http.middlewares.test-redirectregex.redirectregex.replacement: "https://publish.obsidian.md/serve?url=notes.example.com"
            traefik.http.middlewares.test-redirectregex.redirectregex.permanent: "false"
        volumes:
            - /var/nginx/notes:/var/www/html
            - /var/nginx/log:/var/log/nginx
        logging:
            options:
                max-size: 50m

networks:
   default:
      external:
        name: traefik-net

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.