Jump to content

Good Evening,

 

I'm trying to setup a searxng instance via Docker. I'm using a separate VM with Apache2 to handle reverse proxies and Let's Encrypt certs. When I setup Searxng to use its local IP it works fine and I can search, navigate, customize etc. but as soon as I tell it to use a URL I get a 503 error.

 

The docker-compose.yml looks like its using port 8080 to get out;

searxng:
    container_name: searxng
    image: searxng/searxng:latest
    networks:
      - searxng
    ports:
     - "127.0.0.1:80:8080"

So I set up a virtual host to use port 8080;

<VirtualHost *:80>
   ServerName my.url.com
   ProxyPreserveHost On
   ProxyRequests Off
   ProxyPass / http://172.16.137.250:8080/
   ProxyPassReverse / http://172.16.137.250:8080/
RewriteEngine on
RewriteCond %{SERVER_NAME} =my.url.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Any idea what I'm missing? I appreciate the help.

Thank you.

Link to comment
https://linustechtips.com/topic/1450061-docker-network-help/
Share on other sites

Link to post
Share on other sites

I'm not quite sure what you mean by telling SearXNG to use a URL? Do you mean you change the ports configuration in the docker-compose.yml to a URL instead of an IP?

 

Your ports configuration says to listen on port 80 and then forward it to 8080 inside the container. Your Apache configuration on the other hand tries to communicate with port 8080, which isn't available on the host. Docker is configured to listen on port 80 in this case, which conflicts with Apache, who's also listening on port 80.

 

You should change your ports configuration to "8080:8080" (remove the IP) and change your Apache configuration to forward to "127.0.0.1:8080" instead.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
https://linustechtips.com/topic/1450061-docker-network-help/#findComment-15528853
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×