阻止Jenkins访问8080端口

Dun*_*zzz 8 reverse-proxy jenkins

我在我的Ubuntu服务器上安装了一个简单的jenkins,我只是使用它安装sudo apt-get install jenkins,因此,现在可以从指向我的框的所有域访问jenkins,只需添加:8080URL即可.

我已成功配置apache代理jenkins,我可以从中访问它ci.mydomain.com,但我无法弄清楚如何防止jenkins在端口8080上被访问.

这是我的apache conf:

<VirtualHost xx.xx.xx.xx:80>
    ServerAdmin me@mydomain.com
    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>
Run Code Online (Sandbox Code Playgroud)

我在这里遵循了Ubuntu的说明,但它们似乎没有任何效果.

ion*_*ish 10

您可以使用iptables,因为它是Ubuntu,用于阻止对端口8080的所有非本地访问.

iptables -A INPUT -p tcp --dport 8080 -s localhost -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j DROP
Run Code Online (Sandbox Code Playgroud)