Skip to content

Instantly share code, notes, and snippets.

View dbrian's full-sized avatar
🏴‍☠️
Arrg.

Brian Gosnell dbrian

🏴‍☠️
Arrg.
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / wpengine-reverse-proxy-configuration-2022.md
Created June 25, 2022 13:06
Tutorial: How to Configure a Reverse Proxy for Use with WPEngine/Wordpress Sites [2022]

Configuration: How to Configure a Reverse Proxy for Use with WPEngine/Wordpress Sites [2022]

Configure an external proxy from domain.com to install1.wpengine.com.

Make sure you send the Cache-Control $http_cache_control header in your requests to WP Engine. If this isn’t configured you will be permanently logged into /wp-admin and it will not auto logout. That can be a serious security concern.

Make sure you pass the X-Forwarded-For headers to WP Engine so that we see the actual IPs and not the proxy IP. If this isn’t in place, you will get blocked by WP Engine’s firewall.

@nefanov
nefanov / prl
Created January 18, 2017 17:06
process reparent linux
What you ask for is simply impossible. By the design of the Unix and Linux internal process management init becomes the parent of all processes whose parents die. This is because processes must have parents (also by design), and init is always there, for if init dies, the system shuts down. But beyond that there is no such thing as "re-parenting" processes.
EDIT
However: As lord.garbage pointed out, there's the arcane prctl() system call which is wicked cool and makes any program that uses it unportable. Suppose we don't care. Using the PR_SET_CHILD_SUBREAPER option it can wait() not only for its own children (as before) but also for all of their descendants, should their parents die prematurely. Thus a process using this feature can assume the role of init for its descendants. The following code is a proof of concept:
#include <sys/prctl.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>