
Nginx examp'les of configurations:

1. This configuration is for any install of gieta whatever domain configured, 
but will rely in a configured port, so its just a proxy redir forwarded:

Set in gitea.ini those parameters:

```
# [server]
SSH_DOMAIN       = giteavenenux.org:2222
ROOT_URL         = https://giteavenenux.org/gitea/
DOMAIN           = giteavenenux.org
```

Create: /etc/nginx/conf.d/gitea.conf

```
location ^~ /gitea/ {
  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_pass              http://0.0.0.0:3001/;
}
```

2. This configuration will use socket, more efficient, but 
will hiyacked all the webserver root to gitea for subpaths urls must tune up:

Update /etc/gitea/conf/app.ini:

```
[server]
PROTOCOL = unix
DOMAIN = git.giteavenenux.org
ROOT_URL = http://git.giteavenenux.org/
HTTP_ADDR = /tmp/gitea/gitea.sock
HTTP_PORT =
```

Create: /etc/nginx/conf.d/gitea.conf

```
upstream _gitea {
        server unix:/tmp/gitea/gitea.sock;
}

server {
        server_name _;
        root /var/lib/gitea/custom/public;

        location / {
                try_files $uri @proxy;
        }

        location @proxy {
                include proxy_params;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_buffering off;
                proxy_pass http://_gitea;
        }
}
```


