Reputation: 2074
I have one main folder where I work on multiple projects with different languages. The box I use is https://github.com/fideloper/Vaprobash
I'm currently working on a project that uses elixir on the backend with port 4000 and then a node server for the frontend that is running on port 3000
My question is how do I run both servers at the same time?
I use apache vhost to access the specific project for example: projectname.192.168.22.10.nip.io:3000
Upvotes: 1
Views: 215
Reputation: 339
Set multiple port forwarding on your Vagrantfile :
Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 3000, host: 12003, protocol: "tcp"
config.vm.network "forwarded_port", guest: 4000, host: 12004, protocol: "tcp"
end
auto_correct: true
projectname.local will redirect to http://localhost:12003
projectname-back.local wil redirect to http://localhost:12004
Use nginx for the reverse proxy, its very simple to set :)
Upvotes: 1