connect flask API with nginx

This commit is contained in:
Michael Zhang 2015-12-23 13:49:31 -06:00
parent 489c5e596b
commit 5ba6479171
4 changed files with 11 additions and 2 deletions

View file

@ -10,4 +10,12 @@ server {
location / {
try_files $uri $uri/ =404;
}
location ~ /api {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8000;
proxy_redirect off;
}
}

View file

@ -1,3 +1,4 @@
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
db = SQLAlchemy()

View file

@ -5,7 +5,6 @@ import config
import json
import sys
from api.api import api
from flask import Flask
app = Flask(__name__)

View file

@ -1,6 +1,7 @@
<html>
<head>
<title>EasyCTF 2016</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular.min.js" integrity="sha384-r1y8TJcloKTvouxnYsi4PJAx+nHNr90ibsEn3zznzDzWBN9X3o3kbHLSgcIPtzAp" crossorigin="anonymous"></script>
</head>
<body>
<h1>Hello, EasyCTF!</h1>