Anyone know how to server the robots.txt from docker setup with some nginx proxy in front?
> Anyone know how to server the robots.txt from docker setup with some nginx proxy in front?

_Originally posted by @utzer in https://github.com/zedeus/nitter/issues/305#issuecomment-852436466_

Moving to a separate place, to keep the noise down for others.

It depends on what is your setup. How do you provide SSL for the site? Do you use nginx already?

I'm using Traefik v1 (don't have a reason to upgrade, when I will, I'll have an entirely different setup):
```
  traefik:
    image: 'traefik:1.7-alpine'
    container_name: traefik
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
      - './traefik/traefik.toml:/traefik.toml:ro'
      - './traefik/acme.json:/acme.json:rw' # an empty chmod 600 file
    ports:
      - '80:80'
      - '443:443'
    network_mode: proxy
    labels:
      - traefik.enable=false
    restart: always

  robots:
    image: httpd:alpine-utf8
    build:
      context: ./shared_dock/build/httpd
      dockerfile: httpd.dockerfile
    volumes:
      - ./shared_dock/disallow_robots-get_off_my_lawn.txt:/usr/local/apache2/htdocs/index.txt:ro
    depends_on:
      - traefik
    labels:
      - traefik.frontend.rule=Host:redacted.tld,foo.tld,example.com;PathPrefixStrip:/robots.txt
      - traefik.port=80
    networks:
      - proxy
    restart: unless-stopped

  redacted.tld:
    image: 'zedeus/nitter:latest'
    volumes:
      - ./n.c7.ee.conf:/src/nitter.conf:ro
    depends_on:
      - traefik
    labels:
      - traefik.frontend.rule=Host:redacted.tld
      - traefik.port=8080
    networks:
      - proxy
    restart: unless-stopped
```
traefik.toml
```
defaultEntryPoints = ["http", "https"]

[entryPoints]
  [entryPoints.http]
    address = ":80"
      [entryPoints.http.redirect]
        entryPoint = "https"
  [entryPoints.https]
    address = ":443"

      [entryPoints.https.redirect]
      regex = "^https://www.(.*)"
      replacement = "https://$1"
      permanent = true
      [entryPoints.https.tls]
      compress = true

[acme]
email = "redacted@redacted.tld"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
  [acme.httpChallenge]
  entryPoint = "http"

[docker]
watch = true
network = "proxy"
```

I also use a script from https://blog.linuxserver.io allowing rollbacks.

IIRC they have their own Let's encrypt + Nginx thing, you may use that instead of Traefik (v1) as well.