Code Monkey home page Code Monkey logo

0f70d8edbcd478ccebd546cf208e1478fb6c25acc6762ea900cbc92d727d64b6's Introduction

http_helper

OVERVIEW

A simple node.js redirector and proxy application. Given a config file full of redirect and proxy mappings, this application will match incoming HOST headers and take the appropriate action by 301/302 redirecting or proxying.,ss

This is useful for redirecting www to root domains, redirecting old domains to new domains, proxying for SSL from non-SSL sources on AWS.

PREREQUISITES

  • node.js (v0.10.28 preferred)
  • npm (comes with node.js)

PREFLIGHT

  • mv ./config-json.dist to ./config.json
  • Update mappings for redirects/proxies based on your needs

As an example, if we wanted to setup a redirect to yourdomain.com from www.yourdomain.com, we would add the following block in config.json: "www.yourdomain.com": { "host": "http://yourdomain.com", "code": 301, "function": "redirect" }, (Note: The function setting can be either redirect or proxy)

RUNNING THIS APPLICATION

Simply run: node ./bin/server.js

FURTHER INFORMATION

Author: JP Schneider (Github: jdotpz, [email protected]) Bugs/Requests: https://www.github.com/mozilla/http_helper/issues

  • New Relic monitoring is written into this application. Simply provide your own newrelic.js or config settings and it will just work.

  • Messina is an amazing GELF log utility written by Brian Brennan (brianloveswords). To output to your own GELF facility, set the following env variables while running node.

export GRAYLOG_HOST="address.to_your_logging_server.com" #defaults to localhost export GRAYLOG_PORT=12201 #defaults to 12201 export GRAYLOG_FACILITY="httphelper-production" #defaults to openbadger export ENABLE_GELF_LOGS=true

0f70d8edbcd478ccebd546cf208e1478fb6c25acc6762ea900cbc92d727d64b6's People

Contributors

lonnen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.