Last active
May 23, 2018 15:46
-
-
Save DougBeney/a630ad89a1a64fdbb7398cd3aa45e3a7 to your computer and use it in GitHub Desktop.
Minimal Vagrantfile for a basic Nginx static site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>If you are reading this, it worked!</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nginx Config | |
# This is located in [your project directory]/.provisions/site.conf | |
server { | |
server_name localhost; | |
root /var/www/site; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/bionic64" | |
config.vm.network "forwarded_port", guest: 80, host: 8000 | |
config.vm.provision "shell", inline: <<-SHELL | |
apt-get update | |
apt-get upgrade -y | |
apt-get install -y nginx | |
systemctl start nginx | |
ln -sf /vagrant /var/www/site | |
ln -sf /vagrant/.provisions/site.conf /etc/nginx/conf.d/site.conf | |
systemctl reload nginx | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment