Skip to content

Instantly share code, notes, and snippets.

View DevonStrawn's full-sized avatar
💭
Typing...

Devon Strawn DevonStrawn

💭
Typing...
View GitHub Profile
@DevonStrawn
DevonStrawn / app.py
Last active January 18, 2019 06:53
Nginx config for a Flask endpoint that does internal redirect via X-Accel-Redirect and passes a flash message to an OpenResty / Lua endpoint
'''
Flask server that *internal*-redirects to another Nginx endpoint without generating additional HTTP traffic.
Also passes an internaly-only 'flash message' via headers.
'''
from flask import Flask, request, make_response
application = Flask(__name__)
@application.route('/from/flask')