Skip to content

Instantly share code, notes, and snippets.

@mikelittle
Created May 6, 2018 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikelittle/dfb570c0707f2d135bdf36be2d6c9d28 to your computer and use it in GitHub Desktop.
Save mikelittle/dfb570c0707f2d135bdf36be2d6c9d28 to your computer and use it in GitHub Desktop.
Proxy another WordPress site as a subdirectory
location /blog/ {
location ~ \.php$ {
rewrite ^/blog(.*) $1 break;
add_header X-url $1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:8023;
}
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jp
rewrite ^/blog(.*) $1 break;
add_header "Access-Control-Allow-Origin" "*";
access_log off;
log_not_found off;
expires max;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:8023;
}
rewrite ^/blog(.*) $1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass https://127.0.0.1:8023;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment