wordpressprivoxy

Privoxy as intercepting proxy


I want to setup Privoxy to be able to filter all http requests that my Wordpress page are sending and receiving, but I have hard time trying to do it.

I setup Wordpress with bitnami package and privoxy with apt-get install and found out that in order to intercept all of requests I have to turn on "accept-intercepted-requests" and actually redirect them with iptables. I Tried this command to do so:

sudo iptables -t nat -D OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8118

But when I try to access website outside of localhost I have connection refused message.

My question is: is it possible to intercept all http request of webserver with privoxy and iptables or maybe I have to use some other software to achieve this?


Solution

  • I figured it out, so I am posting solution for anyone who also struggles with this:

    sudo iptables -t nat -A PREROUTING -i {INTERFACE_NAME} -p tcp --dport {WEBSITE_PORT} -j REDIRECT --to-port {PROXY_PORT}
    

    where:

    It works with every website that is hosted using Apache. (I tested it also with phpBB and it works with no problems.)