Nginx反向代理:post_action如果代理缓存命中 – Possbile?
发布时间:2020-09-07 23:07:29 所属栏目:Nginx 来源:互联网
导读:我们最近发现了有关nginxes post_action的信息.我们想知道如果进行代理缓存命中,有一种方法可以使用该指令吗?我们希望的流程如下:1) User request comes in 2) If cache HIT goto A / If cache MISS goto B A) 1) Serve Cached Result A) 2) post
|
我们最近发现了有关nginxes 我们想知道如果进行代理缓存命中,有一种方法可以使用该指令吗? 我们希望的流程如下:
如果可以通过post_action或任何其他方法获得任何想法? 这背后的原因如下: 我们本质上希望在显示缓存内容时修改用户会话(php,但相同的概念可以应用于大多数服务器端语言).这将大大增加我们处理的可缓存请求的数量,因为这些请求仅写入会话而不是从会话中读取. 谢谢! 最佳答案 如果你还没有解决它,那么这是一个通过你的要求的示例配置:server {
listen 80;
server_name img1.example;
root /var/www/images;
location / { // Users request comes in
try_files $uri @proxy; // If cache HIT goto A (show) / If cache MISS goto B (@proxy),server cached result
post_action /url.php; // post_action to another url on the backend
}
location @proxy {
proxy_pass http://static.exmaple; // Server request from backend
proxy_store /var/www/images$uri; // Store result from backend (cache)
}
}
(编辑:东莞站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- php – 如何在nginx vhost中添加open_basedir路径
- 如何在将请求传递给上游服务器之前删除Nginx中的客户端标头
- 铁路上的ruby-乘客是否可以使用像Mongrel这样的集群?
- Nginx反向代理到另一个提供静态文件的Nginx服务器
- 安装了gitlab,但只有nginx欢迎页面显示
- ruby-on-rails-在Ruby on Rails生产服务器上为乘客乘机前错
- nginx在docker swarm服务面前
- 模板 – 如何使用ansible循环包含模板变量的数组?
- nginx访问502 gateway,*1 connect() failed (111: Connect
- 网络 – Nginx:直接在text / plain中返回$remote_addr
推荐文章
站长推荐
- ruby-on-rails-使用Nginx的Rails的多阶段环境
- if-statement-仅在存在cookie的情况下如何有条件
- apache – NGINX配置与Socket.IO一起使用
- Nginx – PHP脚本上的基本http身份验证
- Gunicorn和Django与Upstart和Nginx
- 如何在Nginx中使用fastcgi_next_upstream
- linux – 当master从命令行运行时,puppet master
- 身份验证 – nginx auth_basic时间限制
- 通过https/SSL访问NGINX/PHP-FPM时速度极慢
- Nginx server_name regexp不能用作变量
热点阅读
