Recently, I wanted to create a Web site for my team. I originally wanted to use Apache. later I thought that nginx is now popular. let's take a look at nginx. Http://nginx.org/click downloadto Download Windows. I will download version 1.1.14. the compressed package only has 1.08m, which is really small. I decompress it to... recently I want to create a Web site for my team. I wanted to use Apache. later I thought that nginx is now popular, so let's take a look at nginx.
Http://nginx.org/click download windows version, my version is 1.1.14, compressed package only 1.08 M, really small AH. I decompress it to D: \ Developer \ nginx-1.1.14. double-click nginx.exe and a black screen will disappear. View processes
Start two processes
Enter http: // localhost/in the browser/
OK
However, it is too troublesome to enable or disable the process manually. it would be nice to have a tray like apache.
Google, really have, software called nginxtray official website http://nginxtray.codeplex.com/is codeplex open source projects, I under the 1.0 version
Decompress the package to D: \ Developer \ NginxTray 1.0.
Double-click NginxTray.exe to execute multiple icons on the tray.
Enable, disable, and restart functions. However, you must configure the nginx location before use.
Click settings
Nginx Directory is the decompressed Directory of nginx, my is D: \ Developer \ nginx-1.1.14,Note: Be careful when replacing it. some of them are covered by Nginx Directory labels, so I spent half a day.
Now it is easy to start and close.
D: \ Developer \ nginx-1.1.14 \ conf \ nginx. conf is the main configuration file is a bit like httpd. conf, combined with node. js need to modify the file, add under server {
Location/node {
Proxy_pass http: // 127.0.0.1: 1337;
}
Node. js example. js file is as follows:
Var http = require ('http ');
Http. createServer (function (req, res ){
Res. writeHead (200, {'content-type': 'Text/plain '});
Res. end ('Hello World \ n ');
}). Listen (1337, "127.0.0.1 ");
Console. log ('server running at http: // 127.0.0.1: 1337/'); execute node example. js on the command line.
Restart nginx
Enter http://www.2cto.com/node in the address bar
OK is used in combination
From dellheng's column