server {
	listen 192.168.1.2:80;
    server_name git.898.ro;

    listen 192.168.1.2:443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/git.898.ro/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/git.898.ro/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot

    access_log /var/log/nginx/git.898.ro.access.log;
    error_log /var/log/nginx/git.898.ro.error.log;

    ### redirect
    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    } # managed by Certbot

	location / {
		proxy_pass https://mail.898.ro/gitea;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $http_host;
	}

	location /gitea {
		proxy_pass https://mail.898.ro/gitea;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Host $http_host;
	}

}
