# Gradio behind nginx CSS issues

**URL:** <https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966>\
**Category:** 🔒 Gradio\
**Created:** [March 16, 2023, 4:57pm UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966 "2023-03-16T16:57:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kp-on-hface](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@kp-on-hface](https://discuss.huggingface.co/u/kp-on-hface)\
**Post date:** [March 16, 2023, 4:57pm UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966/1 "2023-03-16T16:57:50Z")

</div>

Hey everyone, have a setup where Gradio is hosted behind an nginx route and for some reason the CSS and formatting isn’t coming through. Looks like this:

 ![where the css](https://us1.discourse-cdn.com/hellohellohello/original/2X/1/19a9a4ab1e3651a6a1ae3ada6b6fc3838fcf0e49.png)

My relevant nginx config is pretty straight forward:  
location /gradio/ {  
proxy\_pass [http://127.0.0.1:7860/](http://127.0.0.1:7860/);

```
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    auth_basic "Restricted Content";
    auth_basic_user_file /etc/apache2/.htpasswd;
}

```

I have access to the port through an SSH tunnel and that is working fine.

Anyone run in to something like this? Thank you 🙂

---

<div class="post-metadata">

**Author:** ![freddyaboulton](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/freddyaboulton/32/32732_2.png) [@freddyaboulton](https://discuss.huggingface.co/u/freddyaboulton)\
**Post date:** [March 16, 2023, 5:08pm UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966/2 "2023-03-16T17:08:48Z")

</div>

Sorry, it’s an issue we are aware of and we’re working on it!

> <https://github.com/gradio-app/gradio/issues/3472>
>
> \### Describe the bug
> 
> The UI displays correctly on the local system. But when I …upload it to the server, the UI CSS is not present. 
> 
> \### Is there an existing issue for this?
> 
> \- \[X\] I have searched the existing issues
> 
> \### Reproduction
> 
> NA
> 
> \### Screenshot
> 
> \<img width="1440" alt="Screenshot 2023-03-15 at 12 23 45 AM" src="https://user-images.githubusercontent.com/71621292/225127688-2ce7189c-70f5-44c4-bce7-ee96040967a6.png"\>
> 
> 
> \### Logs
> 
> \`\`\`shell
> No logs. Only a 404 error.
> \`\`\`
> 
> 
> \### System Info
> 
> \`\`\`shell
> This is hosted on railway.app.
> \`\`\`
> 
> 
> \### Severity
> 
> annoying

---

<div class="post-metadata">

**Author:** ![kp-on-hface](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@kp-on-hface](https://discuss.huggingface.co/u/kp-on-hface)\
**Post date:** [April 8, 2023, 12:07am UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966/3 "2023-04-08T00:07:07Z")

</div>

I think this is still an issue, or maybe I have a config problem. Chrome’s console is reporting an inability to load theme.css but it is looking at the root and not the subdirectory (/gradio) I have this pointed at.

The page just shows “Loading…” instead of anything else now. I’m running version 3.24.0:

pip3 show gradio  
Name: gradio  
Version: 3.24.0

---

<div class="post-metadata">

**Author:** ![zyan23](https://avatars.discourse-cdn.com/v4/letter/z/a3d4f5/32.png) [@zyan23](https://discuss.huggingface.co/u/zyan23)\
**Post date:** [May 6, 2023, 8:34pm UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966/4 "2023-05-06T20:34:42Z")

</div>

Hello, how did you solve this “always show loading …”? Also have this problem with nginx for gradio.

---

<div class="post-metadata">

**Author:** ![kp-on-hface](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@kp-on-hface](https://discuss.huggingface.co/u/kp-on-hface)\
**Post date:** [May 11, 2023, 4:02am UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966/5 "2023-05-11T04:02:36Z")

</div>

No solution yet - wonder if it’s a config problem. Just upgraded to the latest Gradio package and no go.

@freddyaboulton, any guidance would be super helpful 🙂

---

<div class="post-metadata">

**Author:** ![RuslanShperlov](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ruslanshperlov/32/16839_2.png) [@RuslanShperlov](https://discuss.huggingface.co/u/RuslanShperlov)\
**Post date:** [June 14, 2023, 2:44pm UTC](https://discuss.huggingface.co/t/gradio-behind-nginx-css-issues/33966/6 "2023-06-14T14:44:09Z")

</div>

You can try to use nginx config from official [doc](https://gradio.app/running-gradio-on-your-web-server-with-nginx/). If it does not help -  
I can try to help your through upwork proposal.
