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 
<https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts>)
 
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!

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/b62aa183-34ed-44cd-876a-369dabf02c1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to