question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

code-server 4.0.0 behind nginx reports wrong port

See original GitHub issue

Using the following nginx configuration (fragment) in combination the SSL and code server reports port 80 in code-server instead of 443/https?

    location / {
      proxy_pass http://localhost:8080/;
      proxy_set_header Host $host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection upgrade;
      proxy_set_header Accept-Encoding gzip;
    }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
tjpalancacommented, Dec 15, 2021

As a temporary solution just in case this helps anyone, I’ve just made sure that X-Forwarded-Host returned the https://<code-server-url>:443 (hardcoded the 443 port) and everything works perfectly.

4reactions
code-ashercommented, Dec 14, 2021

Ah…the headers appear to be lowercased so they do not match. Not sure if they always come that way or if Express lowercases them. 🤦

So I guess forwarded should work since we have it lowercase but not the X- variants. But as mentioned next version will get rid of all this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

code-server 4.0.0 behind nginx reports wrong port · Issue #4607
Same problem with my setup. I'm running code-server via JupyterHub as part of a JupyterLab image with Traefik as a reverse proxy.
Read more >
Usage - code-server v4.8.0 docs - Coder
Using Let's Encrypt with NGINX; Using a self-signed certificate. Port forwarding via SSH. We highly recommend using port forwarding via SSH to access...
Read more >
How To Set Up the code-server Cloud IDE Platform on Ubuntu ...
your-domain with your desired domain, then save and close the file. In this file, you define that Nginx should listen to HTTP port...
Read more >
Using reverse proxy to expose code-server to the internet
You can try using my nginx config, change app URL and app port if needed, put it in /etc/nginx/sites-available than use symlink to ......
Read more >
Avoiding the Top 10 NGINX Configuration Mistakes
We help you avoid the 10 most common NGINX configuration errors, explaining the problems caused by each and how to fix them.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found