If you're using nginx you could add basic HTTP Authentication. Then anytime anyone goes to your docs url or sub-domain they'll get a pop-up user/password dialog before being able to access swagger-ui.
Full instructions for creating your user/password combinations (assuming Ubuntu):
sudo apt-get install apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd exampleuser
The tool will prompt you for a password.
Then update your nginx file to have something like this for the docs route:
location /docs {
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
proxy_pass http://0.0.0.0:3000;
}
Then reload nginx:
sudo /etc/init.d/nginx reload