A simple proxy for wordpress, it can help you to redirect the wordpress resources to a different host, and it can also help you to serve the custom resources.
- Install the dependencies
yarn install
-
Config the
config.toml
, for more details, please refer to the config -
Run the proxy
yarn serve
- Build the docker image
docker build -t wp-proxy .
- Run the docker container
docker run -d -p 8088:8088 -v ./config.toml:/app/config.toml wp-proxy
config the docker-compose.yml
, mount the config file, and run the docker compose
- Run the docker compose
docker compose up -d
The sitemap address is {mounted_host}/{router_prefix}/wp_sitemap/index.xml
, you can use the wp_sitemap_route
to change the sitemap address, the default sitemap address is /wp_sitemap
.
The custom route is the route that the proxy will forward requests to the target host, you can use the custom_routes
to add the custom routes.
support the wildcard, for example:
custom_routes = [
"/(fr|es|ja|de|pt|zh_hans|zh_hant|ko)?/?tool",
"/(fr|es|ja|de|pt|zh_hans|zh_hant|ko)?/?blog",
"/category"
]
The wp resource route is the route that the proxy will forward requests to the target host, you can use the wp_resource_routes
to add the wp resource route, the default wp resource route is /wp-content
, /wp-includes
.
Use the default wp resource route, and nothing else.
The router prefix is the prefix that the proxy will forward requests to the target host, you can use the router_prefix
to add the router prefix, the default router prefix is /
, if you want to use the sub path, you can change the router prefix, for example:
router_prefix = "/wp"
The mounted host is the host that the proxy will mount to, you can use the mounted_host
to add the mounted host, the default mounted host is https://mymap.ai
, if you want to use the sub path, you can change the mounted host, for example:
mounted_host = "https://mymap.ai/wp"
The target host is the host that the proxy will forward requests to the target host, you can use the target_host
to add the target host, the default target host is https://library.mymap.ai
, if you want to use the sub path, you can change the target host, for example:
target_host = "https://library.mymap.ai/wp"