# \[solved\] Proxy settings in gitea docker container

**URL:** <https://forum.gitea.com/t/solved-proxy-settings-in-gitea-docker-container/2920>\
**Category:** Install/Maintain/Configure\
**Created:** [January 28, 2021, 3:20pm UTC](https://forum.gitea.com/t/solved-proxy-settings-in-gitea-docker-container/2920 "2021-01-28T15:20:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![OCram85](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ocram85/32/4947_2.png) [@OCram85](https://forum.gitea.com/u/OCram85)\
**Post date:** [January 28, 2021, 3:20pm UTC](https://forum.gitea.com/t/solved-proxy-settings-in-gitea-docker-container/2920/1 "2021-01-28T15:20:02Z")

</div>

I’m running here into a weird issue with https proxy settings. Gitea is running as ca docker container defined via docker-compose in a docke swarm cluster.

After setting the environment up, I tried to migrate repositories from other gitea instances.  
Unfortunately there is a corporate proxy between the new and old gitea instances.

So I tried to set the environment variables `http_proxy`, `https_proxy` and `no_proxy`. But gitea doesn’t seem to work with them. I always get the same error:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/c/c0689e701369eb0f8d428c25e3372dc833617f95.png)

The container log shows:

```auto
2021/01/28 15:11:30 modules/task/task.go:51:handle() [E] Run task failed: migrate from 'gitea.YYYY.XXXX.com' is not allowed: unknown hostname

```

my docker-composer looks like this:

```auto
gitea:
    image: gitea/gitea:1.13
    ports:
      - "3000:3000"
      - "222:22"
    depends_on:
      - db
    restart: unless-stopped
    environment:
      - "http_proxy=http://user:passwd@proxy.XXX.YYY.net:3128"
      - "https_proxy=http://user:passwd@proxy.XXX.YYY.net:3128""
      - "no_proxy=.xxxx.net,.yyyy.net"
      - "APP_NAME=My Gitea"
      - "RUN_MODE=prod"
      - "DOMAIN=gitea.XXXXx.net"
      - "SSH_PORT=222"
      - "SSH_LISTEN_PORT=22"
      - "DISABLE_SSH=true"
      - "ROOT_URL=https://gitea.XXXXX.net"
      - "LFS_START_SERVER=true"
      - "DB_TYPE=mysql"
      - "DB_HOST=db:3306"
      - "DB_NAME=fooo"
      - "DB_USER=bar"
      - "REQUIRE_SIGIN_VIEW=true"
    deploy:
      replicas: 1
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
        - "traefik.http.routers.gitea.rule=Host(`gitea.XXXXX.net`)"
        - "traefik.http.routers.gitea.entrypoints=http"
        - "traefik.http.routers.gitea.entrypoints=https"
        - "traefik.http.routers.gitea.tls=true"
        - "traefik.http.services.gitea-srv.loadbalancer.server.port=3000"
    volumes:
      - gitea:/data
    networks:
      - traefik-public
      - cicd

```

I also tried the environment vars in uppercase and with a tailing / in the url. Sill the same issue…

Do you have any idea?

##### Testing updates

###### 29.01.2021

- Proxy settings seems to be fine. Started an interactive console of the running container and checked if the env vars are present. Also tested native curl, wget commands which responded the target correctl.

---

<div class="post-metadata">

**Author:** ![OCram85](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ocram85/32/4947_2.png) [@OCram85](https://forum.gitea.com/u/OCram85)\
**Post date:** [February 1, 2021, 9:58am UTC](https://forum.gitea.com/t/solved-proxy-settings-in-gitea-docker-container/2920/3 "2021-02-01T09:58:24Z")

</div>

Although this shouldn’t change anything, I also tried to add the proxy settings into the image itself:

```auto
FROM go-gitea/gitea:1.13
ENV https_proxy <proxy>
ENV http_proxy <proxy>
ENV no_proxy <excludes>

```

Did anyone tried to use a transparent proxy in a docker overlay network?

---

<div class="post-metadata">

**Author:** ![OCram85](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ocram85/32/4947_2.png) [@OCram85](https://forum.gitea.com/u/OCram85)\
**Post date:** [February 17, 2021, 7:59am UTC](https://forum.gitea.com/t/solved-proxy-settings-in-gitea-docker-container/2920/4 "2021-02-17T07:59:03Z")

</div>

Issue solved. The problem was caused by a faulty proxy ha config. _rage_

@techknowlogick: Could you please close this topic? Thanks 😃

---

<div class="post-metadata">

**Author:** ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)\
**Post date:** [February 17, 2021, 2:32pm UTC](https://forum.gitea.com/t/solved-proxy-settings-in-gitea-docker-container/2920/5 "2021-02-17T14:32:04Z")

</div>


