Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

wordpress - Reverse Proxy for API

I have a WordPress installation, but it's behind an IP whitelist firewall. I'd like to make the raw JSON data therein publicly accessible only via the WordPress API. The entire WP instance can't be made public, but I can whitelist an IP for a client/host proxy server.

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. This service won't have any sort of front-end at all. It's only for grabbing and returning JSON from WordPress.

Listen for requests, pass requests to WP, return JSON to requester.

I'm sure something like this has been solved for, I'm just having a hard time getting started.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Well, couldn't you :

  1. Have a simple page on your server calling your wordpress api and printing the JSON result ;
  2. Have a vhost well configured to use different IP for Wordpress and JSON service (see Apache Doc);
  3. Whitelist the IP of the JSON service ?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...