nginx - 都发送错误响应和转发请求到代理
问题描述
我需要回复大量状态为 418 的传入请求。我如何将这些请求代理到不同的服务器(例如存储它们)并同时响应这些请求?
这是我当前的 Nginx 服务器实现:
server {
listen 8080;
server_name localhost;
location / {
index index.html index.htm;
try_files $uri $uri.html $uri/ =404;
# Preload some css
add_header Link "</files/css/example.css>; as=style; rel=preload";
}
# Proxy these requests and respond with 418
location /some/url {
proxy_pass http://127.0.0.1:8000;
}
}
解决方案
推荐阅读
- swift - 编码偏移量弃用
- extjs - 如何在 Ext JS 4 中将按钮置于其容器的中心?
- r - 根据对内的条件过滤数据框
- c# - 错误:通过 API 使用文本框中的值在 Nextcloud 上创建用户/组
- c# - 如何通过 AuthorizationHandlerContext 获取策略名称
- jpa - Spring数据存储库如何查询包含子字符串的String的ElementCollection
- wordpress - 如何使用 ACF 和 cron 作业自动更改帖子类别
- json - Node-RED parse json received from wikimedia api
- html - Outlook 中的电子邮件模板间距中断
- android - 如何通过 Biometric api 查看用户的 Bio-Metric Preference?