# Call gitea as a subdomain of nginx

**URL:** <https://forum.gitea.com/t/call-gitea-as-a-subdomain-of-nginx/266>\
**Category:** Install/Maintain/Configure\
**Created:** [April 27, 2018, 6:18am UTC](https://forum.gitea.com/t/call-gitea-as-a-subdomain-of-nginx/266 "2018-04-27T06:18:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blacksmoke](https://avatars.discourse-cdn.com/v4/letter/b/e19adc/32.png) [@blacksmoke](https://forum.gitea.com/u/blacksmoke)\
**Post date:** [April 27, 2018, 6:18am UTC](https://forum.gitea.com/t/call-gitea-as-a-subdomain-of-nginx/266/1 "2018-04-27T06:18:58Z")

</div>

Hi together,

I have a small Server at home to do different things. One is to use as NAS and local git-server (More will following). As NAS, i run OpenMediaVault on it. Also i add gitea to organize git-repositories.

It works fine, but is only available with “servername:3000”, but i want to have it available like “git.servername” as a subdomain. gittea is running from extra User “git” On this Machine is ngingx running and the main-page is the administration-site of OpenMediaVault.

Does anybody know, how i can solve this ?  
I have try so many things from different forums, but nothing is working for me.

thanks

---

<div class="post-metadata">

**Author:** ![howl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/howl/32/4725_2.png) [@howl](https://forum.gitea.com/u/howl)\
**Post date:** [April 28, 2018, 7:25pm UTC](https://forum.gitea.com/t/call-gitea-as-a-subdomain-of-nginx/266/2 "2018-04-28T19:25:37Z")

</div>

Once you have it set up, it should be fairly easy to set up a subdomain which simply is a reverse proxy to gitea. For instance, this is the nginx config of my gitea instance.

```nohighlight
server {
        listen 80;
        server_name zxq.co www.zxq.co;
        root /home/git/gf/public/;
        # set max upload to 5 mb
        client_max_body_size 5M;
        client_body_buffer_size 256K;

        location / {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_max_temp_file_size 0;
                proxy_pass http://localhost:3000;
        }

    listen 443 ssl http2;
    # SSL SETTINGS (left out)
}

```
