Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse proxy #438

Open
javierspn opened this issue Dec 30, 2024 · 1 comment
Open

Reverse proxy #438

javierspn opened this issue Dec 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@javierspn
Copy link

Hi Team!

I have an instance of Whisper-WebUI running behind a reverse proxy (Nginx proxy manager). Till now it is not working with its public subdomain name.

This is the env file:

CONTAINER_NAME=whisperui
CONTAINER_IMAGE=jhj0517/whisper-webui:latest
TZ=Europe/Madrid
CUDA_VISIBLE_DEVICES=''
POLICY_RESTART=unless-stopped
WHISPER_PORT=8080:7860
WHISPER_MODELS_VOLUME=/docker/data/models:/Whisper-WebUI/models
WHISPER_OUTPUTS_VOLUME=/docker/data/outputs:/Whisper-WebUI/outputs
LOG_TYPE=json-file
LOG_SIZE=10M
LOG_FILES=3

And the compose file:

https://pastebin.com/raw/qrG1MAUL

I generated a TLS certificate with certbot for the subdomain (whisper.mydomain.com) and configured nginx proxy manager to listen into that subdomain. The only special thing about my setup its that it connects to port 445 for external https:

https://whisper.mydomain.com:445 > My firewall > https://nginxproxymanagerproxyhost:443

Whenever I connect to the instance it responds but doesnt' quite end loading:

imagen

It works perfectly fine locally or if I use tailscale.

@jhj0517
Copy link
Owner

jhj0517 commented Dec 31, 2024

Hi, Thanks for raising the issue.
Here're the reads that might help you:

I am not that familiar with deploying app with nginx, but here are the troubleshooting that I experienced:

  1. Make sure you've added "A type" records to your domain service: It should be an public IPv4 address, which you can get by searching "What is my IP?" in Google.

  2. If you use a specific location other than "/" in nginx.conf, you should also pass the --root_path option when starting the app.
    For example, if this is your nginx.conf:

server {
    listen 80;
    server_name example.com;  

    location /my-app/ { 
        proxy_pass http://127.0.0.1:8000/; 
        proxy_buffering off;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

You should pass --root_path as well.

python app.py --root_path "/my-app" --server_name "0.0.0.0" --server_port "8000"
  1. Make sure you've added the ports as an "inbound rule" in your firewall. For you this would be port 445

  2. I don't know about "Nginx Proxy Manager" software, but the gradio needs specific header setting ( e.g. proxy_set_header Upgrade $http_upgrade ) in nginx.conf like the example above, according to the official documentation. So you should try to edit it in the software

No idea what caused the problem with your nginx, but hope this helps

@jhj0517 jhj0517 added the bug Something isn't working label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants