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.

login and logout can't redirect to subpath behind reverse proxy

See original GitHub issue

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Win10
  • Remote OS: Ubuntu 18
  • Remote Architecture: x64
  • code-server --version: 4.0.1

Steps to Reproduce

  1. config Nginx
  2. proxy xxx.com/vscode to 127.0.0.1:5002
  3. start code-server on port 5002

Expected

login: xxx.com/vscode -> xxx.com/vscode/login -> xxx.com/vscode logout: xxx.com/vscode/logout -> xxx.com/vscode -> xxx.com/vscode/login

Actual

login: xxx.com/vscode -> xxx.com/login -> xxx.com/vscode logout: xxx.com/logout -> xxx.com -> xxx.com/login

Logs

login: inlog logout: outlog

Screenshot

login: in1 in2 incss1 incss2

logout: out1 out2 out3

Notes

This issue can be reproduced in VS Code: No

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
code-ashercommented, Jan 11, 2022

I think proxy_pass http://127.0.0.1:5002/; should do it (notice the trailing slash).

code-server expects the reverse proxy to rewrite the path and the way you do that in NGINX is by appending a trailing slash to the proxy pass value (in Caddy it is the uri strip_prefix /vscode line that does this).

0reactions
stale[bot]commented, Jul 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jenkins reverse proxy failing for log in/out pages - Server Fault
I have setup the reverse proxy on the nginx server and it almost works perfectly. The only issue now is that when I...
Read more >
Webpage keeps being redirected to upstream server address ...
My solution was based off this post here: https://unix.stackexchange.com/questions/290141/nginx-reverse-proxy-redirection.
Read more >
Using a Reverse Proxy with WP Engine - Support Center
Due to the intentional layer of abstraction, WP Engine Support is unable to assist with configuring or troubleshooting a reverse proxy ...
Read more >
Web Application Access | Teleport Docs
A join token is required to authorize a Teleport Application Proxy service ... Log in to your cluster with tsh so you can...
Read more >
Changing the reverse proxy URL in the Logout Page ... - IBM
If the Logout Page Configuration details are set up to redirect users to a reverse proxy URL, when particular changes are made to...
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