# Instructions
# Set listen port
# Set proxy_pass value towards bottom of file
# Create your own SSL certificate if you want, one is provided for convenience/testing

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;
    #gzip  on;

    server {
        # -----Set the https port you want to use, 443 is the standard-----
        listen       %httpsport% ssl;
        # -----You can set your dns fqdn here if you want-----
        # server_name  localhost;
        
        #-----Place SSL certs in conf-----
        ssl_certificate      cert.pem;
        ssl_certificate_key  cert.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            proxy_buffering off;
            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_set_header        X-Forwarded-Proto $scheme;

            proxy_connect_timeout      90;
            proxy_send_timeout         90;
            proxy_read_timeout         90;
            
            #-----Set the URL to your EzUGCC install here-----
            proxy_pass http://127.0.0.1:%port%;
            proxy_redirect off;
        }
    }
}