Git Product home page Git Product logo

ressl's Introduction

ressl

A simple importd based SSL redirector. It accepts requests and redirects to the SSL version of the same page.

Why?

I needed something like this for a couple of sites that were hosted on a shared hosting provider but I wanted to only have one process doing the SSL redirects.

Usage

Simply run:

ressl

This launches ressl on port 8000 using Django's runserver management command.

For production use it's strongly recommended to instead use a real WSGI server like gunicorn or uWSGI , e.g.:

gunicorn ressl

To use a different port, use the server's options, e.g.:

gunicorn -b 127.0.0.1:12345 ressl

You must set at least one envrionment variable for ressl to work: RESSL_ALLOWED_HOSTS. It's a comma separated list of host names ressl is allowed to redirect, e.g.:

RESSL_ALLOWED_HOSTS=mycompany.com,myblog.me,myphotos.com gunicorn -b 127.0.0.1:12345 ressl

Debugging is done by setting the environment variable RESSL_DEBUG to any value:

RESSL_DEBUG=yep gunicorn -b 127.0.0.1:12345 ressl

If your site runs behind a proxy, you may have to tell ressl how to figure out if a request is SSL or not. Use the RESSL_PROXY_PROTOCOL environment variable to define it (defaults to 'HTTP_X_FORWARDED_PROTOCOL'):

RESSL_PROXY_PROTOCOL=HTTP_X_FORWARDED_PROTO gunicorn ressl

Feedback

Feel free to open tickets at https://github.com/jezdez/ressl/issues.

ressl's People

Contributors

jezdez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ressl's Issues

LICENSE missing

I was going to borrow your read and find_version methods for my setup.py, but then realized there is no LICENSE.

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.