A SSL redirector for shared hosting environments, e.g. Webfaction
Project description
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. Say thanks at https://www.gittip.com/jezdez/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ressl-0.2.tar.gz
.
File metadata
- Download URL: ressl-0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7ab7881bcbc7b1f3a8dea7dcac75d23a1c5e1f3e921307d323ca675c1a42bd2 |
|
MD5 | fc7b238fbbd697777890979befa6e057 |
|
BLAKE2b-256 | 13f5eb65688788ee2f58da004089aa4eada0278490ac25f4c18f5a969fb01e53 |