NGINX Reverse Proxy Setup

Hello, Sorry if this as been asked before but I'm stuck in trying to setup a reverse proxy using NGINX Proxy Manager. I followed the steps as normal for adding a proxy host in NGINX but Coder is keeps reporting redirect too many times. I have looked into the following documentation: https://coder.com/docs/faqs#how-do-i-configure-nginx-as-the-reverse-proxy-in-front-of-coder https://github.com/coder/coder/tree/main/examples/web-server/nginx https://coder.com/docs/admin/configure I have tried editing the config file, but that did not solve the problem. Can anyone advise. Kind Regards
GitHub
coder/examples/web-server/nginx at main · coder/coder
Provision remote development environments via Terraform - coder/coder
Configuration - Coder Docs
Learn how to configure Coder
From An unknown user
From An unknown user
From An unknown user
FAQs - Coder Docs
Frequently asked questions
From An unknown user
From An unknown user
From An unknown user
No description
No description
30 Replies
Codercord
Codercord5mo ago
<#1247279713500532857>
Category
Help needed
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
fisherd91
fisherd915mo ago
Hello, Can anyone advise please.
Phorcys
Phorcys5mo ago
hey @fisherd91, any luck? your nginx config looks fine, I think your access URL might be wrong could you send your coder.env or env variables for Coder over? (w/ sensitive info redacted of course)
fisherd91
fisherd915mo ago
Hello, still not sorted. Not sure were to get the coder.env. Looked in the docker folder and cannot see one. Do you mean the docker enviroments?
Phorcys
Phorcys5mo ago
yes that's what I mean coder.env is for standalone installations
fisherd91
fisherd915mo ago
Here is my docker variables (using Unraid)
fisherd91
fisherd915mo ago
No description
Phorcys
Phorcys5mo ago
are you using Coder or code-server?
fisherd91
fisherd915mo ago
code-server through a docker
Phorcys
Phorcys5mo ago
oh alright yeah then those docs don't apply you might want to hide your password
fisherd91
fisherd915mo ago
its not the real password in that image and I havent got using .env to work (still learning)
Phorcys
Phorcys5mo ago
i meant in the config your config says to bind on 8080 but your screenshot says to use 8443, could that be related? i'm not familiar with Unraid also in your nginx configuration I don't see any IP configured for the proxy_pass directive
fisherd91
fisherd915mo ago
due to using the NGIXX proxy manger, that is all controlled by that docker.
fisherd91
fisherd915mo ago
No description
fisherd91
fisherd915mo ago
that config file was found very deep in the app folder. might not be relevant as i didn't set that file up
Phorcys
Phorcys5mo ago
just a quick heads up, 8443 is usually used for HTTP/s traffic on an alternate port, I would recommend against 8443/443 if your traffic is http I think that config file should say 8443 instead of 8080 for it to work
fisherd91
fisherd915mo ago
it was just the port number in the docker template. Tried changing it with no different Changed and restarted - wont launch. getting the following errors ─────────────────────────────────────── GID/UID ─────────────────────────────────────── User UID: 99 User GID: 100 ─────────────────────────────────────── setting up sudo access setting sudo password using SUDO_PASSWORD env var python3 already installed [custom-init] No custom files found, skipping... [2024-06-15T13:30:00.709Z] info code-server 4.90.2 dce1d6e172cc5f935b9732e7dee4b7a992529eda [2024-06-15T13:30:00.712Z] info Using user-data-dir /config/data [2024-06-15T13:30:00.748Z] info Using config file /config/.config/code-server/config.yaml [2024-06-15T13:30:00.748Z] info HTTP server listening on http://0.0.0.0:8443/ [2024-06-15T13:30:00.749Z] info - Authentication is enabled [2024-06-15T13:30:00.749Z] info - Using password from $PASSWORD [2024-06-15T13:30:00.749Z] info - Not serving HTTPS [2024-06-15T13:30:00.749Z] info - Proxying the following domain: [2024-06-15T13:30:00.749Z] info - {{port}}.code.REMOVED [2024-06-15T13:30:00.750Z] info Using proxy URI in PORTS tab: //{{port}}.code.REMOVED [2024-06-15T13:30:00.750Z] info Session server listening on /config/data/code-server-ipc.sock [ls.io-init] done. [14:30:01] [14:30:01] Extension host agent started. [14:30:01] [10.0.0.7][6d1b9dba][ExtensionHostConnection] Unknown reconnection token (never seen). [14:30:10] [10.0.0.7][4a9767ae][ManagementConnection] Unknown reconnection token (never seen). Changed the config.yaml back and restart and the docker works again. I think that file is internal for the docker and not meant to be user editable Just noticed, getting alot of these appear in the terminal. I cant find any information on the ports tab. Is something i meant to enable
fisherd91
fisherd915mo ago
No description
Phorcys
Phorcys5mo ago
where are you seeing this? actually i have an idea could you send the contents of conf.d/include/proxy.conf? could you show the advanced tab too?
fisherd91
fisherd915mo ago
right next to terminal tab. Have no clue.
fisherd91
fisherd915mo ago
No description
fisherd91
fisherd915mo ago
Were is this. cant see any file for this
Phorcys
Phorcys5mo ago
terminal tab in code-server?
fisherd91
fisherd915mo ago
yea when i open it locally throu the browser.
Phorcys
Phorcys5mo ago
so it only fails when you're accessing it from your domain it's generated by nginx proxy manager if that can help i see it mentioned here in your second screenshot
fisherd91
fisherd915mo ago
oh, my bad. add_header X-Served-By $host; proxy_set_header Host $host; proxy_set_header X-Forwarded-Scheme $scheme; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_pass $forward_scheme://$server:$port$request_uri; thats the contents of the file.
深雪
深雪5mo ago
Port forwarding should work out of the box with nginx proxy manager, make sure you add your wildcard domain in the domain names, e.g. *.coder.placeholder.com
fisherd91
fisherd914mo ago
Tried adding the wildcards to the nginx proxy manager, no difference was resulted. At the moment, I have nearly given up trying to fix this. I will try to find another solution.
Want results from more Discord servers?
Add your server