首页 > 解决方案 > 都发送错误响应和转发请求到代理

问题描述

我需要回复大量状态为 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;
    }
}

标签: nginx

解决方案


推荐阅读