Development environment Problem (win7+vbox+centos+nginx+php), save JS file has a problem

Source: Internet
Author: User
Tags sendfile
In order to develop cool, I win7 under the VBox, shared folders, development environment set in VBox in CentOS. But when you save the JS file, there are some inexplicable things, the browser will read the JS file error. However, this file is normal as long as it is opened and saved in Linux.

Tried a lot of methods, than how to save file format, Utf8,utf8 BOM, etc., useless
Is there a difference between saving files under Linux and Win7 (the format of Win7 shared files is NTFS)


Reply to discussion (solution)

I didn't use VBox.
I use Samba, win map Samba directory, win with NetBeans or EditPlus write JS no problem
Do not know your JS error message is what

Echo Base64_encode (file_get_contents (' Problematic JS file '));

Output to Base64, Byond compare exactly the same
It doesn't make sense. js file is a problem with browser parsing.
For the next preservation of the wool Linux can be used?

I'm guessing the nginx cache problem is looking for this problem

Yes, I want to see what's inside.
You won't show it to me, then forget it.

The problem is clear, but no solution is found.

I changed a JS file under Windows, then the browser access, error, I am under Linux cp this file, and then delete it, then the backup file CP back to the original file, OK.

That is, Nginx caches the mischief.
I set the static file access cache expires to off
Will introduce the file plus a changed version number, or can not solve the problem

It is also important to note that the format of the shared folder is vboxsf, which may not function properly with the Linux sendfile module. Some common Web servers such as Nginx and Apache, if the Sendfile module is enabled in their configuration file, may cause errors in response to file content to the client. About the specific description of the problem, interested students can Google "vboxsf sendfile" understand. The current recommendation is to refer to the specific configuration methods of these services and disable the Sendfile module to ensure that the contents of the file can be sent correctly.

Perfect solution:
Nginx settings
Sendfile on change to OFF
This is limited to the development environment

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.