Fix compilation when Nginx is configured with OpenResty.

Patch contributed by Yichun Zhang. Closes GH-1226.