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/;
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,
Any ideas?
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?
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"
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.
I am very much a noob when it comes to nginx, so I don’t completely understand what to do
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 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:
<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:
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.