Nginx与Tomat的组合环境基本配置
[*]安装tomcat8
[*]安装nginx-1.6.0
下载地址:http://nginx.org/download/nginx-1.6.0.zip
下载后解压缩即可;
配置nginx的代理到tomcat的访问路径
修改nginx-1.6.0\conf\nginx.cnf文件,其中红色部分为修改的两处位置:
server { listen 80;
server_namelocalhost:8080;
#charset koi8-r;
#access_loglogs/host.access.logmain;
location / {
proxy_pass http://localhost:8080;
}
3.运行tomcat/bin目录下的startup.bat命令启动tomcat8
4.运行nginx.exe程序启动nginx,运行后CMD窗口会直接关闭,nginx也已经启动了
5.测试验证:在浏览器中输入:http://localhost 发现页面已经转向了tomcat的默认管理页面,这表示nginx与tomcat联姻成功了!
页:
[1]