Cache configuration

Hello everyone!

A cache issue…

I created an XML file order.xml with this simle cotent:

<?xml version="1.0" encoding="utf-8"?> John D. Foo Str. 3, 10117 Berlin

and saved it on my VM in /var/www/sandbox/test/. As you can see, it’s
not a
valid XML (s. tag address). So the browser (XML parser) threw an error.

Then I repaired the file. But the browser is still throwing the same
eoor.

It’s defently the server(-side) cache, since I’ve already tried it out
in
several browsers.

How can/should I set up the cache behavior of nginx?

Posted at Nginx Forum:

It’s probably browser caching - Did you try pressing Ctrl+F5 or clearing
your browser’s cache?

Posted at Nginx Forum:

As I’ve already said: It can only be the server(-side) caching. Since
revoming of the browser cache and Ctrl+F5 don’t help.

But now I think, it might be an issue of the virtual machine. Because
when I
edit the files directly from the VM* and not in my hosst system,
sometimes I
can see the changes in the Browser.

  • The files are saved in a shared folder, so I can access to them both

    from the host and also from the guest system.

Posted at Nginx Forum:

When using virtualbox shared folders, you need to turn off sendfile in
nginx.

Posted at Nginx Forum:

Great, it works! Thank you very much!

Posted at Nginx Forum:

Didn’t know it. Thank you for the info!

Posted at Nginx Forum:

On Monday 28 January 2013 21:48:59 automatix wrote:

Great, it works! Thank you very much!

That is an old well-known bug in VitualBox. See:
https://www.virtualbox.org/ticket/819
#9069 (shared folder doesn't seem to update => Fixed in 6.0.6) – Oracle VM VirtualBox
Pitfalls and Common Mistakes | NGINX

wbr, Valentin V. Bartenev

http://nginx.org/en/donation.html

Hello!

I have to reopen this topic, because the issue is back…

I have a basic host file, that defines thr root folder for a host as:

file ax-common-vhost

server {
if ($host ~ ^(?.+).(?.+).loc$) {
set $folder “$area/$project”;
}

root /var/www/$folder/;
}

Now I want to add another basic vhost file for Zend Framework projects.
There the webroot should be in the older “public” directly under the
root.
So I created a copy of my basic vhost file with a new root rule:

ax-zf-vhost

server {
if ($host ~ ^(?.+).(?.+).loc$) {
set $folder “$area/$project”;
}

root /var/www/$folder/public/;
}

file zf1sandbox.sandbox.loc

include /etc/nginx/sites-available/ax-zf-vhost;

But it’s not working. The server tries to open the path of the
zf1sandbox
project root, cannot find any index file there and throws a 403 error.

I’ve already set the sendfile setting to “off” in all relevant
files/segments:

file nginx.conf

http {

sendfile off;

}

file ax-zf-vhost

server {
location / {
index index.html index.php;
sendfile off;
}
}

Posted at Nginx Forum:

Sorry, my mistake. It’s another problem. The server is not analyzing my
zf1sandbox.sandbox.loc file, that includes the template for Zend
Framework
vhosts (include /etc/nginx/sites-available/ax-zf-vhost;), but is using
my
common template (ax-common-vhost).

Posted at Nginx Forum: