Docker restart not showing the desired effect

前端 未结 2 480
南笙
南笙 2021-01-16 18:16

I have a small nginx based test application that I want to run inside a docker container. So I followed the example given here docker installation

So I have a foder

相关标签:
2条回答
  • 2021-01-16 18:52

    So I found this known bug with VirtualBox VM that is used for running Docker on Mac. When we have shared content between our host machine and the VirtualBox, then only we face this bug. There is a optimisation as far as web servers like nginx, apache (and apparently vertx) are concerned. Whenever we request a static file from the server, it uses sendfile to provide us with the file. The bug is that in case of VirtualBox (in the scenario described above) we always get the first version of the file no matter what we try. The workaround for this in case of nginx and apache is to turn sendfile off . However, there is a hack that we use as far as vertx is concerned.

    1. rename the file say login.html to login.html.moved (anything)
    2. curl :/….../login.html (we won’t get anything)
    3. rename the file back to its original name login.html.moved to login.html
    4. Hard refresh the page (Command + Shift + R).

    For further reading about this bug consult the following

    Link1

    Link2

    Link3

    Link4

    0 讨论(0)
  • 2021-01-16 19:13

    I assume it is a caching problem. Did you try to set expires -1 in your index.html location configuration to disable server side caching for static files?

    0 讨论(0)
提交回复
热议问题