Hi,
I am trying to setup a sample flask application proxy through OpenBSD
httpd. Here is the config -
-------------------------------</etc/httpd.conf>-------------------
ext_ip="192.168.1.111"
prefork 2
server "default" {
listen on $ext_ip port 80
root "/htdocs"
location "/hello/*" {
fastcgi socket ":8888"
}
}
types {
text/css css
text/html html htm
text/plain txt
image/gif gif
image/jpeg jpeg jpg
image/png png
application/javascript js
application/xml xml
}
-------------------------------</etc/httpd.conf>-------------------
The flask app is
-------------------------------<Flask App>-------------------
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "<h1 style='color:blue'>Hello There!</h1>"
if __name__ == "__main__":
app.run(host='127.0.0.1')
I am running UWSGI as -
-------------------------------<Flask App>-------------------
$ uwsgi --http :8888 --wsgi-file myproject.py --master --callable app
$ curl http://127.0.0.1:8888/
returns the contents, but when I access the page as
http://192.168.1.111/hello/
I get 500.
Any pointers will be helpful.
Regards.
--
Ajitabh Pandey
http://ajitabhpandey.info/