# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.


####
#
#    Example configuration script for nginx webserver used in combination with
#    a WSGI server such as gunicorn running on port 8888.
#
#    This assumes the flyscript_portal directory has been installed under
#    the root directory /flyscript.  Make sure to update the paths below to
#    match your configuration.
#
#    You will also need to update the IP address under `proxy_pass` to
#    match your localhost IP.  When running under a virtual machine,
#    just setting this to 127.0.0.1 doesn't seem to reliably work.
#
####


server {
    listen 8000;
    server_name webapp.org;

    access_log /flyscript/flyscript_portal/access.log;
    error_log /flyscript/flyscript_portal/error.log;

    location /static {
        root /flyscript/flyscript_portal;
    }

    location / {
        proxy_pass http://10.0.2.15:8888;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

