1
0
Fork 0
mirror of https://github.com/docker/awesome-compose.git synced 2025-04-26 02:38:07 +02:00

init nginx-wsgi-flask

Signed-off-by: Grant Birkinbine <grant.birkinbine@gmail.com>
Signed-off-by: grantbirki <grant.birkinbine@gmail.com>
This commit is contained in:
Grant Birkinbine 2021-03-20 22:10:46 -07:00 committed by grantbirki
parent a92c067f75
commit d294c393a5
10 changed files with 312 additions and 0 deletions

View file

@ -0,0 +1,27 @@
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello World!"
@app.route('/cache-me')
def cache():
return "nginx will cache this response"
@app.route('/info')
def info():
resp = {
'connecting_ip': request.headers['X-Real-IP'],
'proxy_ip': request.headers['X-Forwarded-For'],
'host': request.headers['Host'],
'user-agent': request.headers['User-Agent']
}
return jsonify(resp)
@app.route('/flask-health-check')
def flask_health_check():
return "success"