简体   繁体   English

Nginx作为Apache的代理

[英]Nginx as a proxy to Apache

My project contains all files whose extensions are either .php, .js and .css .. No .html is there.. I have set up Nginx using port 80 and Apache using port 8080 in localhost.. Nginx is said to handle the static things very fast and pass the php to Apache.. So since my project does not have any .html files Nginx is supposed to bypass everything to Apache.. So how is Nginx helping here? 我的项目包含所有扩展名为.php,.js和.css的文件。不存在.html。.我在本地主机中使用端口80设置了Nginx,使用端口8080设置了Apache。事情很快,然后将php传递给Apache。。因此,由于我的项目没有任何.html文件,因此Nginx应该绕过Apache的所有内容。 And if not, then what should I do to utilize Nginx.? 如果没有,那么我应该怎么利用Nginx。

Is it possible to see the current running stats of Apache's and Nginx's.? 是否可以查看Apache和Nginx的当前运行状态?

Sorry, if these questions seems to be of amateur type but I am just a fresh mint here..and I need help here... 抱歉,如果这些问题似乎是业余问题,但是我在这里只是个新鲜薄荷。在这里我需要帮助...

Nginx is surely responsible here to show the css and js files which are probably not ajax like jquery.min.js which are static quickly..And if you consider caching the contents like image and all, Nginx will serve a purpose here... Nginx肯定负责在这里显示可能不是ajax的css和js文件,例如jquery.min.js,它们是快速静态的。如果考虑缓存诸如image和all之类的内容,Nginx将在这里起到作用...

You said that many of the js you have used are ajax . 您说过,您使用的许多js都是ajax。 So why not show the .html pages in the website and pull the dynamic data from other php pages to the html page you are showing via ajax.. In that case Nginx will serve a purpose as well... 因此,为什么不显示网站中的.html页面,而将其他php页面中的动态数据通过ajax提取到您显示的html页面中呢。在这种情况下,Nginx也将达到目的...

Here is a tool which you can use to see the stats... Check this out. 这是一个可以用来查看统计信息的工具。 Cacti 仙人掌

I'm not an expert..But I tried my best to answer..Hope this helps.. 我不是专家。.但是我尽了最大的努力。

I recall one more reason to use nginx. 我记得使用Nginx的另一个原因。 In prevents "slow client attack" to Apache. 在防止对Apache的“慢客户端攻击”。 It could be not an attack per se, but many valid client with slow connection. 它本身并不是攻击,而是许多连接缓慢的有效客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM