I followed a tutorial and have got an nginx server running on a Vagrant VM (using Chef as a provisioner). I only have a single html page, index.html
, and if I make changes to it and run vagrant provision
the changes are reflected when I go to the page in my browser. However, I also have a css and js file that nginx is serving, and if I make changes to them the changes aren't reflected on the page, even after I reload the VM. This is despite the fact that I can SSH into the VM and verify that the newer versions of the files are indeed on the VM. I can't figure out how the heck the VM even has access to the older files as I overwrote them when I made the changes. Maybe there's something wrong with my nginx config file? Here is is:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/vagrant/project/webroot;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
I have all 3 files (the js, css and html) file stored in webroot
on the VM. Like I said, I can SSH in and verify that they're all where they're supposed to be, so I think it must be a configuration issue. Do I need to do something special for css and js files?