# Location issue ?proxied page not displaying correctly

**URL:** <https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744>\
**Category:** NGINX\
**Tags:** subfilter, css, reverse-proxy\
**Created:** [April 2, 2025, 9:22am UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744 "2025-04-02T09:22:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chewiesw](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@chewiesw](https://community.nginx.org/u/chewiesw)\
**Post date:** [April 2, 2025, 9:22am UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/1 "2025-04-02T09:22:49Z")

</div>

I have a working solution for my other sites but I am trying to add a new location setting for the Hompepage Dashboard. This is my current config for Hompepage.

location /homepage/ {  
proxy\_pass [http://192.168.1.72:3000/](http://192.168.1.72:3000/);  
proxy\_set\_header Host $host ;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header X-Forwarded-Proto $scheme;  
add\_header Front-End-Https on;  
proxy\_redirect off;  
}  
When I browse to the page it opens however everything is squashed on the left handside,

 ![homepage](https://d7a5pgbt9tjl6.cloudfront.net/original/2X/7/76591da5cfade03e09f282f38bb0979504039179.png)

Any ideas?

---

<div class="post-metadata">

**Author:** ![Damian\_Curry](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Damian\_Curry](https://community.nginx.org/u/Damian_Curry)\
**Post date:** [April 2, 2025, 4:55pm UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/2 "2025-04-02T16:55:27Z")

</div>

It looks like the css is not being loaded correctly, most likely because the URI’s are not being proxied correctly. Can you see any failed requests in the error or access logs?

---

<div class="post-metadata">

**Author:** ![chewiesw](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@chewiesw](https://community.nginx.org/u/chewiesw)\
**Post date:** [April 4, 2025, 3:02pm UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/3 "2025-04-04T15:02:35Z")

</div>

I don’t see anything in the error logs. Below is what I see in the access log. First line mentions CSS.

`11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /api/config/custom.css HTTP/2.0" 200 2418 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/b1a9255a.7d6a8c3a7e4f31ae.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/css/1f91944966e9bbbd.css HTTP/2.0" 200 2420 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/2982.af359c91e63fc58d.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/7474.8725af1c51c959f2.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/478.ab63d08176c0d90a.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/26b4713f.f2510099f5bcb346.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/9592.051a686edbeedb64.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/d5ac9709.4970ddfc6caed1a7.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/1979.cbbf8aaa35a29ffa.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/3895.525d5d2a70ddf852.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/9779.a6d1450d598feffa.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/402.a1c6e4ea73ba1e4c.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/2578.933c814a08243ba6.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/8957.ad01e9560a881d2a.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/4358.310c436e9b34409b.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/774.0fe49a38b993baaa.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/6804.3086c08c0fda3cb7.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/74.b2e331f4f97be169.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/ab2253a0.4db05ad1542cd6e1.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/4128.9f3f9147b5ecc0dd.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/webpack-f6d1923b143144af.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/framework-bbeeca9707659ffa.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/main-eef365d63bd0feb8.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/pages/_app-be40f233c89f9c78.js HTTP/2.0" 200 2427 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/548a922e-5e6e00349531e311.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/457d11d8-40d30b0e55d8617a.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/9c850f74-65c08c9023ea6d08.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/01325ca9-dba60c85d1796e46.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/89a3b566-116d47e5947a2e85.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/708-67899712b0395008.js HTTP/2.0" 200 2423 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/chunks/pages/index-3a04b80eb558747c.js HTTP/2.0" 200 2427 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/nYHomD1Q0qauGQ3vIcK8l/_buildManifest.js HTTP/2.0" 200 2441 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /_next/static/nYHomD1Q0qauGQ3vIcK8l/_ssgManifest.js HTTP/2.0" 200 2441 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /site.webmanifest?v=4 HTTP/2.0" 200 2410 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /homepage.ico HTTP/2.0" 200 2410 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:43 +0100] "GET /favicon-32x32.png?v=4 HTTP/2.0" 200 2410 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" 11.11.11.11 - - [04/Apr/2025:15:49:44 +0100] "GET /favicon-16x16.png?v=4 HTTP/2.0" 200 2410 "https://www.myurl.com/qbit/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0" `

---

<div class="post-metadata">

**Author:** ![Damian\_Curry](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Damian\_Curry](https://community.nginx.org/u/Damian_Curry)\
**Post date:** [April 9, 2025, 12:03am UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/4 "2025-04-09T00:03:56Z")

</div>

Based on those logs, it looks like the CSS is under the `/api` and `/_next` uri’s, and based on the config you shared it is only proxying traffic that is for the `/homepage` uri. You will need to setup additional location blocks to be able to route those requests properly to the backend application.

---

<div class="post-metadata">

**Author:** ![chewiesw](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@chewiesw](https://community.nginx.org/u/chewiesw)\
**Post date:** [April 9, 2025, 9:52am UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/5 "2025-04-09T09:52:04Z")

</div>

I am very much a noob when it comes to nginx, so I don’t completely understand what to do

---

<div class="post-metadata">

**Author:** ![Damian\_Curry](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@Damian\_Curry](https://community.nginx.org/u/Damian_Curry)\
**Post date:** [April 9, 2025, 11:49pm UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/6 "2025-04-09T23:49:40Z")

</div>

There are a few different ways to fix this problem, and as I thought more about it I think that leveraging the [sub\_filter module](https://nginx.org/en/docs/http/ngx_http_sub_module.html) is the best solution for this. When you look at the page source, you should be able to see how it is referencing the css files, something like this based on the logs:

```auto
<link href="/api/config/custom.css" type="text/css" rel="stylesheet" /> 

```

You would then setup the sub\_filter directives to rewrite that path to prepend the `/homepage` to the path in the location block. This might not be exact, but something along these lines:

```auto
sub_filter_once off;
sub_filter_types text/css application/javascript;
sub_filter "'/" "'/homepage/";

```

That should add the `/homepage` to the css and js file paths referenced in the webpage, which should then route the request to the proxied application.

---

<div class="post-metadata">

**Author:** ![system](https://drob5swvtjqxg.cloudfront.net/user_avatar/community.nginx.org/system/32/19_2.png) [@system](https://community.nginx.org/u/system)\
**Post date:** [July 7, 2025, 5:29pm UTC](https://community.nginx.org/t/location-issue-proxied-page-not-displaying-correctly/1744/7 "2025-07-07T17:29:20Z")

</div>

Closed on July 7, 2025, 5:29pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
