Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static file get delivered the same data, even when the content changes from host side #205

Open
ChristianRiesen opened this issue Feb 5, 2018 · 0 comments

Comments

@ChristianRiesen
Copy link
Contributor

Reproduction Steps:

  1. Create drifter box with only the base, git and php-fpm roles (to install nginx)
  2. Put any file from host in the folder, ending in html, css or the likes and load it, to see content.
  3. Alter file on host, then reload file in browser.
  4. Although the file changed, the browser does not display the changed content (headers show a change, like etag etc)

Expected behavior:

File content should change.

Observed behavior:

The sendfile option in nginx sends the content of the file descriptior, which is the content when first accessed by nginx. When the file changes on the host, this does not seem to be refreshed. It only works if the file is changed from within (ssh) the actual box. Seems to be mainly an issue with Virtualbox as far as I saw it.

Drifter version: 1.5.0
Vagrant version: 2.0.0
OS and version: Windows 10 and Mac OSX (current as of 5.2.2018)

Additional information:

  • Problem started happening recently, didn't happen in an older version of Drifter: No
  • Problem can be reliably reproduced, doesn't happen randomly: Yes
  • Problem happens to my colleagues aswell: Yes

Potential fix
Setting the sendfile option from on to off in /etc/nginx/nginx.conf fixes it immediately. This role fixed it for me reliably:

- name: Apply nginx fix for sendfile
  become: yes
  lineinfile:
    dest: /etc/nginx/nginx.conf
    regexp: "sendfile on;$"
    line: "sendfile off;"
    owner: root
    group: root
  notify: restart nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants