I'm trying to determine if there's a bug in Vagrant or in nginx.
I have the following
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise32"
config.vm.network "private_network", ip: "10.0.1.7"
config.vm.network :forwarded_port, guest: 8080, host: 9005
end
So I run
vagrant up && vagrant ssh and the server provisions and spins up. I want to *manually* install nginx on my new VM, so (per
the instructions) for installing nginx on Ubuntu 14.04) I then run:
sudo apt-get update
sudo apt-get install nginx
nginx installs. I run
mkdir ~/mysite and then I change the
/etc/nginx/nginx.conf file to:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
location / {
root /home/vagrant/mysite
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include servers/*;
}
And then I run
nginx -s reload. The error I receive is:
vagrant@precise32:~$ nginx -s reload
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2016/12/22 00:35:20 [emerg] 1423#0: invalid number of arguments in "root" directive in /etc/nginx/nginx.conf:21
My understanding is that `vagrant` should be a user on the VM with sudo access and root permissions. No? Can anyone reproduce this and figure out why I'm unable to reload nginx with my custom `nginx.conf` file? If it can be determined to *not* be a Vagrant issue I'll happily take it up with the nginx folks or possibly StackOverflow. Thanks!