I have a bare-bones install of jenkins on my Ubuntu server that I installed using just sudo apt-get install jenkins
, as a result, jenkins is now accessible from all the domains that point to my box by simply adding :8080
on the the URL.
I have successfully configured apache to proxy jenkins to I can access it from ci.mydomain.com
, but I cannot work out how to prevent jenkins from being accessible on port 8080.
Here is my apache conf:
<VirtualHost xx.xx.xx.xx:80>
ServerAdmin [email protected]
ServerName ci.mydomain.com
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyRequests Off
<Proxy http://localhost:8080/*>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
I've followed the Ubuntu instructions here, but they didn't seem to have any effect.
iptables
since it's Ubuntu, to block all non-local access to port 8080.iptables -A INPUT -t tcp --dport 8080 -s localhost -j ACCEPT
andiptables -A INPUT -t tcp --dport 8080 -j DROP
--dport
option being unrecognised though, add this as an answer maybe?