Cannot use nginx proxy
Hello everyoneI use nginx to proxy gradio app, for example,https://ip:port/chat/ agenthttp://127.0.0.1/Can’t find theme.css, can’t join websocket. How do I set it up
2023-04-21T20:51:14Z
please look at this live example, using Nginx with Gradiohuggingface.conginx.conf · radames/nginx-gradio-reverse-proxy at mainWe’re on a journey to advance and democratize artificial intelligence through open source and open science.huggingface.coNginx Gradio Reverse Proxy - a Hugging Face Space by radamesDiscover amazing ML apps made by the community
2023-07-07T16:34:25Z
hello , your sample can proxy gradio in a root path ‘/’, but it is failed to proxy in a path like ‘/blabla’, the page is blank. do you have any idea to make this OK ?
2023-07-07T16:37:19Z
do you have any route serving on/the Space manager needs something on/in order to successfully load
2023-07-07T16:45:33Z
do you mean the websocket ? i saw the websocket connection request is coming to the ‘/’ path, is it some way to fix this ?
2023-07-07T17:50:19Z
can you please share you nginx.conf?
2023-07-08T00:02:23Z
here is my nginx.conf which flow by your example , it is work....
server {
                                                listen       8000;
                        server_name somedomain 192.168.1.200;

#location / {
#        root /usr/share/nginx/html;
#        index index.html;
#    }

                location / {

proxy_pass http://192.168.1.253:7860;
        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-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_cache_bypass $http_upgrade;
        proxy_read_timeout 86400;
        proxy_redirect off;

                }

        }here is the folder path version which FAILED:location /test {

proxy_pass http://192.168.1.253:7860;
        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-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_cache_bypass $http_upgrade;
        proxy_read_timeout 86400;
        proxy_redirect off;

                }

        }it is failed by not show the web ui, instead show up the json result “not found”
2023-07-15T01:50:28Z
Maybe this could help someone to configurereverse proxy for Gradio.