reverse proxy and wordpress

28
Edmund Turbin - Solutions Engineer [email protected] WordPress and Reverse Proxy How WordPress can integrate with enterprise websites

Upload: edmund-turbin

Post on 15-Apr-2017

1.464 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

WordPress and Reverse ProxyHow WordPress can integrate with enterprise websites

Page 2: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

About Me

Solutions Engineer @ WP Engine Front End Dev

Agencies, Publishing, Ad Tech

Edmund Turbin

Page 3: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

What is a Proxy

I make a request

proxy gets what I asked for

Page 4: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Forward Proxy

client makes request to proxy proxy gets request from server

proxy returns request caches request

Intermediary assocated with the client

Page 5: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Proxy

The cloud

FORWARD PROXY

Page 6: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Reverse Proxy

client makes request external proxy

returns cached request or, gets request from server

Intermediary assocated with the server

Page 7: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Varnish

The cloud

CACHING DIAGRAMServer

Page 8: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Why Reverse Proxy?

Not on the same network custom application

Legacy system transition Users restricted to system by role

Two systems on the same domain

Page 9: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Reverse Proxy and WordPress

WordPress to handle content external system to integrate seamlessly

same domain users will not be able to tell they’re on two systems

How does this apply to WordPress?

Page 10: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Enterprise WordPress

Page 11: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Enterprise WordPress

What makes WordPress enterprise ready?

Scalability

Security Complex Integrations Multilingual Support

SSO / Access Control

Page 12: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Enterprise WordPress

Who’s Using WordPress in enterprise?

Page 13: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Enterprise WordPress

Large community No license costs Extensible - Many integrations

Stable, actively maintained, trusted Simple for users, content creators

What are the benefits?

Page 14: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Enterprise WordPress

No support

Awareness in enterprise market

What are the challenges?

Page 15: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Solutions

Proxy pass from WordPress Proxy pass from external website

CDN based solution Subdomains

Page 16: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

RequirementsProxy Pass to/from WordPress Block requests from other servers Update links to reflect site structure

wp-config.php plugin

Page 17: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Whitelist IP

Allow access from only a single IP

Page 18: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

nginx

PROXY PASSif URL matches: fetch content from other server

location /some/site { proxy_pass http://127.0.0.1; }

Page 19: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

wp-config

define('WP_HOME','http://site.com/subfolder/'); define('WP_SITEURL','http://site.com/subfolder/');

$_SERVER['REQUEST_URI'] = '/subfolder' . $_SERVER['REQUEST_URI']; $_SERVER['SCRIPT_NAME'] = '/subfolder' . $_SERVER['SCRIPT_NAME']; $_SERVER['PHP_SELF'] = '/subfolder' . $_SERVER['PHP_SELF'];

Page 20: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

WordPress Reverse Proxy

The cloud

App 1 App 2site.com/blog

site.com/appsite.com

REVERSE PROXY 1

Page 21: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

WordPress Load Balancer

The cloud

App 1 App 2site.com/blog

site.com/appsite.com

REVERSE PROXY 2

Page 22: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Simpler Solutions

3rd party DNS level split Requests will not pass through additional infrastructure

If issues arise, troubleshooting is narrowed down

Page 23: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Content Delivery Networks

Page 24: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

WordPress Load Balancer

The cloud

App 1 App 2site.com/blog

site.com/appsite.com

REVERSE PROXY 3

CDN

Page 25: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

Subdomains

Simple solution Create subdomain with your domain registrar

Forward the subdomain to new site Mask the domain so that the original URL displays

Page 26: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

WordPress Load Balancer

The cloud

App 1 App 2blog.site.com

site.com/appsite.com

REVERSE PROXY 4

Page 27: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

The Future

Couldn’t we just use the REST API?

Page 28: Reverse proxy and WordPress

Edmund Turbin - Solutions [email protected]

@spicecadet edmundturbin.com [email protected]

twitter: web:

email: