# Copyright 2024 Associated Universities, Inc.
#
# This file is part of Telescope Time Allocation Tools (TTAT).
#
# TTAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# TTAT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with TTAT.  If not, see <https://www.gnu.org/licenses/>.
#
http {
server {
    listen 4444;
    # client_max_body_size 50m;

    location / {
        proxy_pass http://localhost:4200;
        proxy_set_header Host $host;
        proxy_set_header Upgrade    $http_upgrade;
        proxy_set_header Connection $http_connection;
    }

    location /api/ {
        proxy_pass http://webtest.aoc.nrao.edu/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
    }

    # error_page 500 502 503 504 /50x.html;
    # location = /50x.html {
        # root /usr/share/nginx/html;
    # }
}
}
events {}
