mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-25 02:08:06 +02:00
init (#120)
Signed-off-by: Grant Birkinbine <grant.birkinbine@gmail.com>
This commit is contained in:
parent
a42a8531ab
commit
4480b64e58
10 changed files with 313 additions and 0 deletions
27
nginx-wsgi-flask/flask/app.py
Normal file
27
nginx-wsgi-flask/flask/app.py
Normal 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"
|
Loading…
Add table
Add a link
Reference in a new issue