I'm using NGINX to load balance a docker swarm cluster on Digital Ocean. I have swarmpit
installed and I want to reverse proxy to it with an ssl certificate and using a custom port so that I can privately access it and restrict traffic.
I'm not using any custom paths or anything fancy. I'm literally just reverse proxying from the root path under a subdomain to the container.
The page does load but it seems like anything not in the root doesn't load and either comes up with a 404 or a 401 error. As a result the page appears broken with only the root-level content loading.
Server Config
server {
listen #### ssl;
ssl_certificate /etc/letsencrypt/live/###.#####.###/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/###.#####.###/privkey.pem;
include snippets/ssl-params.conf;
include snippets/optimize-assets.conf;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'Upgrade';
proxy_cache_bypass $http_upgrade;
proxy_pass http://swarmpit;
}
}
Upstream Block
upstream swarmpit {
server ###.###.###.###:###;
server ###.###.###.###:###;
server ###.###.###.###:###;
server ###.###.###.###:###;
server ###.###.###.###:###;
}
I also have many defaults set in the nginx.conf file such as
nginx.conf
...
proxy_redirect off;
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_set_header X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
...
What I'm seeing though is
An example of one of the 404 responses
Request URL: https://###.#####.###:####/css/rc-slider.css
Request Method: GET
Status Code: 404 Not Found
Remote Address: ###.###.###.###:####
Referrer Policy: no-referrer-when-downgrade
Connection: keep-alive
Content-Length: 555
Content-Type: text/html
Date: Sat, 30 May 2020 05:50:54 GMT
Server: nginx/1.18.0
Accept: text/css,*/*;q=0.1
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Cookie: _ga=#####
DNT: 1
Host: ###.#####.###:####
Referer: https://###.#####.###:####/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 OPR/68.0.3618.125
I'm not sure why this isn't working but I've run out of help after a lot of Googling and I'm sure it's something that's probably simple. Any help is appreciated.