简体   繁体   English

API 的反向代理

[英]Reverse Proxy for API

I have a WordPress installation, but it's behind an IP whitelist firewall.我有一个 WordPress 安装,但它位于 IP 白名单防火墙后面。 I'd like to make the raw JSON data therein publicly accessible only via the WordPress API.我想让其中的原始 JSON 数据只能通过 WordPress API 公开访问。 The entire WP instance can't be made public, but I can whitelist an IP for a client/host proxy server.整个 WP 实例无法公开,但我可以将 IP 列入客户端/主机代理服务器的白名单。

Diagram attached.附图。

I'd imagine some sort of Node or React setup, but am hoping for something more direct, like a reverse proxy setup using Apache/NGINX.我会想象某种 Node 或 React 设置,但我希望有更直接的东西,比如使用 Apache/NGINX 的反向代理设置。 This service won't have any sort of front-end at all.这项服务根本没有任何类型的前端。 It's only for grabbing and returning JSON from WordPress.仅用于从 WordPress 抓取并返回 JSON。

Listen for requests, pass requests to WP, return JSON to requester.监听请求,将请求传递给 WP,将 JSON 返回给请求者。

I'm sure something like this has been solved for, I'm just having a hard time getting started.我确信这样的事情已经解决了,我只是很难开始。

在此处输入图像描述

Well, couldn't you:好吧,你不能:

  1. Have a simple page on your server calling your wordpress api and printing the JSON result;在您的服务器上有一个简单的页面,调用您的 wordpress api 并打印 JSON 结果;
  2. Have a vhost well configured to use different IP for Wordpress and JSON service (see Apache Doc );将 vhost 配置为对 Wordpress 和 JSON 服务使用不同的 IP 服务(请参阅ZE9713AE04A04A02A81074ZF3 Doc
  3. Whitelist the IP of the JSON service?将 JSON 服务的 IP 列入白名单?

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

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