Configure SearXNG to use Apache as reverse proxy instead of Caddy in Oracle Linux 8. This guide shows how to safely disable the Caddy container and configure Apache for SearXNG access.
# Stop and remove Caddy container docker-compose stop caddy docker-compose rm caddy # Edit docker-compose.yml to remove Caddy service # (see Docker Compose Changes section below) # Restart all containers to apply changes docker-compose down docker-compose up -d
Remove or comment out the entire Caddy service section from docker-compose.yml:
# services: # caddy: # container_name: caddy # image: caddy:2-alpine # network_mode: host # volumes: # - ./Caddyfile:/etc/caddy/Caddyfile:ro # - caddy_data:/data # - caddy_config:/config
Create two VirtualHost configurations for HTTP and HTTPS:
<VirtualHost *:80> ServerName search.yourdomain.com Redirect permanent / https://search.yourdomain.com/ </VirtualHost> <VirtualHost *:443> ServerName search.yourdomain.com SSLEngine on SSLCertificateFile /etc/letsencrypt/live/search.yourdomain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/search.yourdomain.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf ProxyPreserveHost On ProxyPass / http://127.0.0.1:8888/ ProxyPassReverse / http://127.0.0.1:8888/ ErrorLog /var/log/httpd/search.yourdomain.com_error.log CustomLog /var/log/httpd/search.yourdomain.com_access.log combined </VirtualHost>
Test the configuration:
# Check Apache syntax sudo apachectl configtest # Restart Apache sudo systemctl restart httpd # Verify SearXNG is accessible curl -I https://search.yourdomain.com