worker_processes 1;
user root root;

events { worker_connections 1024; }
http {

    sendfile on;

    upstream gitea {
        server basecamp-0:3000;
    }

    server {
	#listen 80;
	#server_name basecamp-0;
	listen 443 ssl;
        listen [::]:443 ssl;
       	http2 on;
	server_name localrepo.cloudnative.zone
        charset utf-8;
        client_max_body_size 300m;
	# Paths to certificate files.
        ssl_certificate /etc/ssl-dom/fullchain.pem;
        ssl_certificate_key /etc/ssl-dom/privkey.pem;
        # File to be used as index
        index index.html;

        # Overrides logs defined in nginx.conf, allows per site logs.
	# error_log /dev/stdout warn;
	#access_log /dev/stdout main;

        location / {
            proxy_pass http://gitea/;

            proxy_redirect   off;
            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Forwarded-Proto $scheme;
	    proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-NginX-Proxy true;
            proxy_set_header Referer $http_referer;
            proxy_http_version 1.1;
            proxy_hide_header X-Powered-By;
        }

        location /doc/ {
            autoindex on;
            alias /doc/;
        }
    }
    server {
      listen 80;
      listen [::]:80;
      return 301 https://$host$request_uri;
    }
}
