# If your IRIX workstation doesn't have up to date TLS/SSL curl, 
# you can use this local nginx proxy on a machine in your LAN to 
# forward sginet-light-http uptime pings
#
# On a "modern" workstation or server, place this in /etc/nginx/available-sites and activate the site.
# On your SGI box, add a 12 minutes recurring cron job to launch:
# sginet-light-ping -P --proxyhost $your_nginx_host --port 8077

server {
    listen 8077;
    server_name sginet-proxy;

    # Incoming:  /sginet/foo/bar?x=1
    # Outgoing:  https://api-gw-eu01.flexion.ch/sginet/foo/bar?x=1
    location /sginet/ {
        proxy_pass https://api-gw-eu01.flexion.ch:443;
        proxy_http_version 1.1;

        proxy_set_header Host api-gw-eu01.flexion.ch;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto http;

        proxy_ssl_server_name on;
        proxy_ssl_name api-gw-eu01.flexion.ch;
    }
}
