宇宙主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

欧基零壹微头条IP归属甄别会员请立即修改密码
楼主: Router

nginx前端+apache后端——这样配置有没有效果?

[复制链接]
发表于 2011-12-1 16:27:25 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2011-12-1 16:28:29 | 显示全部楼层
楼主看见楼上泪牛满面
发表于 2011-12-1 16:32:36 | 显示全部楼层
  1.                 location ~ \.php$ {
  2.                         proxy_pass http://127.0.0.1:81;
  3.                         include proxy_params;
  4.                 }

  5.                 location / {
  6.                         try_files $uri @apache;
  7.                 location ~ .*\.(jpeg|jpg|gif|png|bmp|ico|js|css|swf)$ {
  8.                         expires      12d;
  9.                 }
  10.                 }
  11.                 location @apache {
  12.                         proxy_pass http://127.0.0.1:81;
  13.                         include proxy_params;
  14.                 }

  15.                 location /status {
  16.                         stub_status on;
  17.                         access_log   off;
  18.                 }

复制代码
 楼主| 发表于 2011-12-1 16:33:01 | 显示全部楼层
原帖由 Kokgog 于 2011-12-1 16:28 发表
楼主看见楼上泪牛满面


我要do他妹
发表于 2011-12-1 16:33:05 | 显示全部楼层
原帖由 Kokgog 于 2011-12-1 16:28 发表
楼主看见楼上泪牛满面

kvm在猥亵你
发表于 2011-12-1 16:36:43 | 显示全部楼层
1.先过location ~ \.php$滤一次动态文件的请求
2.剩下的交给location /
3.排除了动态文件后,try_files从root path;下面判断静态文件存在,遇上伪静态的.html会去请求apache
存在的文件则直接输出
发表于 2011-12-1 16:37:12 | 显示全部楼层
原帖由 lazyzhu 于 2011-12-1 16:33 发表

kvm在猥亵你

该ID的原身表示鸭梨不大
发表于 2011-12-1 16:38:08 | 显示全部楼层
Kokgog.康姆  表示压力不大
发表于 2011-12-1 16:40:58 | 显示全部楼层
原帖由 Kvm 于 2011-12-1 16:38 发表
Kokgog.康姆  表示压力不大
whois -h whois.nic.xxx miemie.xxx
NOT FOUND

GO GO GO
 楼主| 发表于 2011-12-1 16:44:31 | 显示全部楼层
原帖由 Kvm 于 2011-12-1 16:36 发表
1.先过location ~ \.php$滤一次动态文件的请求
2.剩下的交给location /
3.排除了动态文件后,try_files从root path;下面判断静态文件存在,遇上伪静态的.html会去请求apache
存在的文件则直接输出 ...


复制你的也一样,如果不存在的静态文件,提示:
Not Found
The requested URL /a.xml was not found on this server.

还是apache在处理,如果把xml加到下面中,就变成nginx处理了
location ~ .*\.(xml|jpeg|jpg|gif|png|bmp|ico|js|css|swf)$
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|兜哪儿主机交流论坛

GMT+8, 2024-9-20 14:56 , Processed in 0.060448 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表