如何在 Ubuntu 中停用特定 URL

如何在 Ubuntu 中停用特定 URL

我的 VPS 上確實運行著一個 Web 伺服器。我想禁用 Ubuntu 中的一個連結。 // 透過說停用,我的意思是拒絕在該 URL 上衝浪

例子;我確實有這個連結: http://SERVER_IP:PORT/#/,我想啟用此連結。但我想禁用此連結:http://SERVER_IP:PORT/api/。我該怎麼做?

我試過;

iptables -A INPUT -m string --string "http://SERVER_IP:PORT/api/" --algo kmp --to 65535 -j DROP
iptables -I INPUT 1 -p tcp --dport 80 -m string --string "http://SERVER_IP:PORT/api/" --algo kmp -j DROP
iptables -A INPUT -s http://SERVER_IP:PORT/api/ -j DROP
iptables -I INPUT 1 -p tcp --dport PORT -m string --string "http://SERVER_IP:PORT/api/" --algo kmp -j DROP

相關內容