Busy for several days, and finally small achievements, sharing, also for example, I generally around the wall, badly beaten beginners reference.
First of all, I want to achieve, if you do not want the current I am powerless.
The purpose is simple. Pictures and file downloads from previous projects are placed in the project and are now on the file server.
The project is both a Java Web JSP project and a file server with Nginx in the Liunx (CENTOS6) system.
The picture that is displayed is the picture that is accessed in the Nginx and the file is downloaded.
Prerequisite: Java Web project run no problem, Nginx has been built.
Modify the nginx.conf file,
192.168.1.113 is a virtual machine that installs both the IP of the Nginx system. The picture is placed under the directory NGINX/MOU/PHT, and so is the file.
You can access Tomcat on this computer after the browser in the Windows system enters 193.168.1.113/carriage return. You can access the published items later with the project name. Ashamed of my style has dropped ... You can access the project as you do with native IP. It's two ways of visiting.
The first location is to intercept a picture request on a virtual machine, and the second is to file a download. Add that line is to prevent the browser directly to display TXT, that is, directly download the meaning of the file.
First, make sure that the browsers on the virtual Machine and window System have no problems accessing the pictures in the Nginx. Download is also the same OH.
In a Web project, the picture src to display is changed to the IP of the virtual machine and the interception rules that you set yourself. Files are the same.
Share My directory structure:
Look at the effect:
Finally spit the sentence, the cache is too powerful ... Remember to clear out the cache.
And also. If the browser in the virtual machine can access resources on the Nginx, but not on this machine (window), and both can ping the same, use service iptables stop on the Liux system and try again after shutting down the firewall.
If the picture is not accessible, please click http://forgetlove.iteye.com/blog/2004352