searx / searx-docker

Create a searx instance using Docker
GNU Affero General Public License v3.0
404 stars 67 forks source link

How to use Nginx as a proxy instead #93

Closed ghost closed 3 years ago

ghost commented 3 years ago

I have a web server where I host several services using Nginx as a reverse proxy. I can't expose Caddy on port 443 or I get an error because it's already in use by Nginx. I tried rebinding the port so that Caddy exposed to 2547 so that I could just use Nginx to proxy Caddy.

  caddy:
    container_name: caddy
    image: caddy:2-alpine
    restart: on-failure
    network_mode: host
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy-data:/data:rw
      - caddy-config:/config:rw
    environment:
      - SEARX_HOSTNAME=${SEARX_HOSTNAME:-localhost}
      - SEARX_TLS=${LETSENCRYPT_EMAIL:-internal}
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE
      - DAC_OVERRIDE
    ports:
      - '2547:443'

But when I do that I'm told:

ERROR: for caddy  "host" network_mode is incompatible with port_bindings

I see that section that it's talking about in the docker-compose.yaml file but I don't know much about Docker so I'm not sure what I could do to resolve this.

unixfox commented 3 years ago

duplicate of https://github.com/searx/searx-docker/issues/63