tobychui / zoraxy

A general purpose HTTP reverse proxy and forwarding tool. Now written in Go!
https://zoraxy.arozos.com
GNU Affero General Public License v3.0
2.63k stars 153 forks source link

[Possible BUG] using "PORT" enviroment lead to unresponsive GUI and "time out" requests to the proxy #260

Open NeoMod opened 1 month ago

NeoMod commented 1 month ago

What happened?

I have been using Zoraxy for a while under docker, with a simple compose file and the latest tag on Portainer Business 2.20.3

services:
  zoraxy:
    image: zoraxydocker/zoraxy:latest
    container_name: zoraxy
    networks:
       neobridge:
           ipv4_address: 172.18.0.8
    ports:
      - 80:80
      - 443:443
      - 8081:8000/tcp
    volumes:
      - /mnt/user/dockerdata/zoraxy_data/:/opt/zoraxy/config/
      - /var/run/docker.sock:/var/run/docker.sock
      - /etc/localtime:/etc/localtime #added from latest example
    environment:
      - ARGS=-noauth=false
      #- PORT=8081 #commented out after issue discovery, working good so far.
      - FASTGEOIP=true
    labels:
      - "net.unraid.docker.icon=/mnt/user/dockerdata/icons/zoraxy.png"

networks:
  neobridge:
    external: true

Recently I noticed I had what appeared to be an issue with my reverse proxies: they were pointing to the default webpage instead of the respective services.

I did a bit of research and found out about this comment and after a quick inspection I discovered all the .config files were missing the OriginIpOrDomain value.

I recovered the previous backup and restarted the container. However, I noticed another issue: the admin interface wasn’t available; all proxies were working as expected but I couldn’t reach the admin interface on my custom port (8081).

While checking for other changes, I noticed the presence of this “warning” inside the docker folder.

image

Describe what have you tried

I then changed the compose file to reflect this “new but also not-new” change (as PassiveLemon kindly noted in #259) and for a while the situation seemed resolved. Although I could notice other issues sporadically appearing while using other services behind reverse proxy, (mainly “timed out” requests resulting in abnormal request termination), I didn’t notice immediately but after a while that the admin interface was again not available.

Seeing the “PORT” option is mentioned in the description but not in the docker file provided, I tried starting Zoraxy without it and it worked. So far it’s working correctly, the admin menu is available without issues, and staying responsive on custom port for admin interface. Now, the question would be…is this a bug or a simple misunderstanding about some documentation in need of an update?

Describe the networking setup you are using

PassiveLemon commented 1 month ago

I believe it works when removing the PORT argument because Zoraxy defaults to port 8000 and you are forwarding 8081 to internal 8000 which would should just work. Changing the PORT argument changes the Zoraxy management interface port so you would then need to forward port 8081 to the internal 8081. I don't know if you did this already but it's not in the Docker compose you supplied. Example here

As for the timeouts, that might be misconfigured Zoraxy configuration in which Toby can help with.

You do have the deprecated ARGS flag in environment, however this shouldn't cause any issues as that variable isn't used anywhere.

Seeing the “PORT” option is mentioned in the description but not in the docker file provided, I tried starting Zoraxy without it and it worked.

Not quite sure what you mean by its not in the Dockerfile, it's defined on line 37 and used in 45 and 47

tobychui commented 1 month ago

I am not sure what you mean by timeout. Have you tried rollback to v3.0.7 or do a fresh instillation on v3.0.9 (if you are running docker)? I do aware that the updater in v3.0.9 works a bit weird in docker, but if the configurations are correct (i.e. you have use the backup config and manually fixed the empty OriginIpOrDomain field issue), everything should be working as expected.