后端开发|php教程
quot,Tomcat,HTML,Nginx,gt
后端开发-php教程
因为基于不同的协议传输消息,一般的网络架构都是前端是Apache 或者 Nginx处理静态请求,Tomcat处理动态请求,做到动静分离,提高了网站和系统性能。
幻影游戏源码,vscode如何图文并排,try ubuntu 卡死,怎么清空tomcat日志,花 爬虫,沧州php招聘,淮北seo推广品牌公司,滚动个人网站模板,整站网站模板 论坛lzw
以下记录本地用nginx+tomcat实现的动静分离的主要步骤。
怎么查看客户端源码,vscode怎么引入css文件,ubuntu终端隐藏,Ps查tomcat进程,爬虫的源码,php 换一换功能,南坪放心的seo优化口碑,网站维护php源码,网站登陆模板下载lzw
1. tomcat web应用jsp文件
c语言标准库函数源码,ubuntu下装载gcc,tomcat 项目架构图,爬虫领域霸主,php倒序数组,法库企业抖音seo优化要多少钱lzw
路径:D:\nginx-1.8.0\Tomcat\tomcat-node1\webapps\examples\index.jsp
session id:" + session.getId());%>
images:
2. nginx主配置文件
upstream local_tomcat { server localhost:18080; server localhost:18081;}server { listen 80;server_name localhost; location / { root html; index index.html index.htm; }# 所有静态请求都由nginx处理,存放目录为htmllocation ~ \.(gif|jpg|jpeg|png|bmp|swf)$ {roothtml;}# 所有动态请求都转发给tomcat处理location ~ \.(jsp|do)$ {proxy_passhttp://local_tomcat;} error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
3. 拷贝静态文件
将图片复制到nginx本地目录,这里我们为了方便并且为了目录的一致性,将其源码全部拷贝至nginx节点:
D:\nginx-1.8.0\Tomcat\tomcat-node1\webapps\examples ==========> D:\nginx-1.8.0\html\examples
4. 测试截图
访问URL:http://localhost/examples/index.jsp
刷新后:
参考:
1. /articles/uA36biz
2. http://dl528888./2382721/804596
3. /code-snippet/3037/nginx-configuration-file-de-location-explain-in-detail
版权声明:本文为博主原创文章,未经博主允许。
以上就介绍了Nginx + Tomcat 实现动静分离,包括了方面的内容,希望对PHP教学有兴趣的朋友有所帮助。