简体   繁体   English

自定义反向代理

[英]Custom reverse proxy

We have a Webapplication which is hosted on server A. One of our customers has a Wordpress instance hosted on server B. We can't host the Wordpress instance on server A. 我们有一个Web应用程序托管在服务器A上。我们的一位客户有一个Wordpress实例托管在服务器B上。我们无法在服务器A上托管Wordpress实例。

We could use seperate subdomains but this would be bad for SEO. 我们可以使用单独的子域,但这对SEO不利。

We are thinking about building a 'reverse proxy': 我们正在考虑建立“反向代理”:

If a request is directed to Webapplication A it should reply the request. 如果将请求定向到Web应用程序A,则它应答复该请求。 But is a request is done on a specific directory the application should get te content from the corresponding url on the WordPress instance and reply it to the client. 但是请求是在特定目录上完成的,应用程序应从WordPress实例上的相应url获取内容并将其回复给客户端。 We have a working proof of concept of this. 我们对此有一个有效的概念证明。 All heavy content like css, js and images is requeste by the client directly. 客户端直接请求所有重内容,例如css,js和images。

However, we are concerned about: 1) Logins in WordPress 2) Forms posted 但是,我们担心:1)WordPress登录2)表单发布

Can this be done or should we just forget about it...? 可以做到这一点,还是我们应该忘记它...?

You can use nginx as proxy for some uri or methods/etc for server B and proxying them to server A. 您可以将nginx用作服务器B的某些uri或method / etc的代理,并将其代理到服务器A。

proxy_pass on nginx.org nginx.org上的proxy_pass

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

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