Skip to content

jamescarr/nginx-subfilter-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Demonstration of ngx_http_sub_module

This is a very simple demonstration of the nginx sub_filter module and how to use it to replace content served up by nginx.

Prerequisites

To run this demo you will need

Running It

To run this demo simply run docker-compose up from the project base. There are then two URLs:

  • http://<dockerhost>:5000 - direct node.js application
  • http://<dockerhost>:80 - nginx proxy

You can use curl or httpie to test this all out.

Directly Against the App

$ http http://$(docker-machine ip):5000
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/html
Date: Tue, 26 Apr 2016 03:28:43 GMT
Transfer-Encoding: chunked

<h1>Hello World</h1>

Against the Nginx Proxy

$ http http://$(docker-machine ip):80
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/html
Date: Tue, 26 Apr 2016 03:28:47 GMT
Server: nginx/1.9.14
Transfer-Encoding: chunked

<h1>Goodbye World</h1>

About

A quick demo of using ngnix's subfilter module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published