LoginSignup
4
3

More than 5 years have passed since last update.

VagrantをProxy環境下で使う

Last updated at Posted at 2019-04-12

得意のプロキシネタ。
現場がプロキシ環境下なので大体詰まります。

プラグインをインストールする

vgrant-proxyconfというプラグインを使います。
ということでインストール

set http_proxy=http://{proxy_ip}:{proxy_port}
set https_proxy=http://{proxy_ip}:{proxy_port}

vagrant plugin install vagrant-proxyconf

setで設定した「http_proxy」「https_proxy」は今後のためにも環境変数に設定しておいてください。

Vagrantfileを修正する

if Vagrant.has_plugin?("vagrant-proxyconf")
    config.proxy.http     = "http://{proxy_ip}:{proxy_port}"
    config.proxy.https    = "http://{proxy_ip}:{proxy_port}"
    config.proxy.no_proxy = "localhost,127.0.0.1"
end

認証プロキシの場合

環境が認証プロキシでないので、確認はしていませんが、
こんな感じで書けば行けると思います。

http://username:password@proxyhost:port
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3