Title: Logout does not work behind reverse proxy · Issue #4503 · coder/code-server · GitHub
Open Graph Title: Logout does not work behind reverse proxy · Issue #4503 · coder/code-server
X Title: Logout does not work behind reverse proxy · Issue #4503 · coder/code-server
Description: Updated by @jsjoeio What's the problem I'm solving? With the latest changes to use the upstream server in code-server, we're now running into issues with our reverse proxy not using the correct URL for the Log out functionality.. The spe...
Open Graph Description: Updated by @jsjoeio What's the problem I'm solving? With the latest changes to use the upstream server in code-server, we're now running into issues with our reverse proxy not using the correct URL...
X Description: Updated by @jsjoeio What's the problem I'm solving? With the latest changes to use the upstream server in code-server, we're now running into issues with our reverse proxy not using the...
Opengraph URL: https://github.com/coder/code-server/issues/4503
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Logout does not work behind reverse proxy","articleBody":"_Updated by @jsjoeio_\r\n\r\n## What's the problem I'm solving?\r\n\r\nWith the [latest changes](https://github.com/cdr/code-server/pull/4414) to use the upstream server in code-server, we're now running into issues with our reverse proxy not using the correct URL for the Log out functionality.. The specific code we're talking about lives [here](https://github.com/cdr/vscode/blob/main/src/vs/server/webClientServer.ts#L317).\r\n\r\nWhen using a reverse proxy (i.e. [Caddy](https://caddyserver.com/)/[NGINX](https://nginx.org/en/)), the /logout endpoint is incorrect because it has the wrong base path and protocol.\r\n\r\n## What are some ways to go about it?\r\n\r\nThe most ideal way to solve this is to use _relative endpoints_. This way, code-server doesn't care about the base path or protocol. It only knows and uses relative paths.\r\n\r\n## How will things change/what is the need for maintenance?\r\n\r\nI am not sure if there is historical context I may be missing which would explain why we didn't use a relative path from the start (or rather why upstream didn't). Patching this in `vscode` means it's something we'll need to keep an eye on as we continue staying in line with upstream.\r\n\r\nI can't imagine this introducing any breaking changes but it could potentially break in specific environments if they don't support using relative paths for some reason 🤔 (though none specifically come to mind).\r\n\r\n## How to reproduce\r\n\r\nAsher outlined steps below to reproduce this issue locally. To do so, follow these steps:\r\n1. install [Caddy](https://caddyserver.com/) (`brew install caddy`)\r\n2. start code-server locally with `yarn watch`\r\n3. serve it at as base path like `/code` with Caddy\r\n```Caddyfile\r\nhttp://localhost:8082/code/* {\r\n\turi strip_prefix /code\r\n\treverse_proxy 127.0.0.1:8080\r\n}\r\n```\r\n4. navigate to [http://localhost:8082/code/](http://localhost:8082/code/) (trailing slash is important!) \r\n5. Open the Menu and click Logout\r\n\r\n### Expected\r\n\r\nYou are redirected to `http://mydomain.com/logout`\r\n\r\n### Actual \r\n\r\nYou should be redirected to `http://mydomain.com/code/logout`\r\n\r\nShould be similar to the fix for [this issue](https://github.com/cdr/code-server/issues/4476). See PR [here](https://github.com/cdr/vscode/pull/17).","author":{"url":"https://github.com/code-asher","@type":"Person","name":"code-asher"},"datePublished":"2021-11-12T19:53:59Z","url":"https://github.com/coder/code-server/issues/4503"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2bed2b5a-451c-d167-9bc0-bf8fc77f678c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A53E:19F84C:347CE2E:42BB41B:6B01C9E1 |
| html-safe-nonce | fa240fc51ab615f5fafe7203891a7b58919c0694e2d517d2c300295526538dde |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTNFOjE5Rjg0QzozNDdDRTJFOjQyQkI0MUI6NkIwMUM5RTEiLCJ2aXNpdG9yX2lkIjoiMTM4MjUwNDk3OTI3NzkzMTIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 58af1084677aaaceab12e624ab52e0feb87486cbf3e8f0c8d7e6344fd37d8ebb |
| hovercard-subject-tag | issue:1052363884 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/code-server/4503/issue_layout |
| twitter:image | https://opengraph.githubassets.com/48157f763e1de798f26b50d3c3d5cef44c2ace37a13bb6ed6bcc5bd6466c8006/coder/code-server/issues/4503 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/48157f763e1de798f26b50d3c3d5cef44c2ace37a13bb6ed6bcc5bd6466c8006/coder/code-server/issues/4503 |
| og:image:alt | Updated by @jsjoeio What's the problem I'm solving? With the latest changes to use the upstream server in code-server, we're now running into issues with our reverse proxy not using the correct URL... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | code-asher |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/code-server git https://github.com/coder/code-server.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 172953845 |
| octolytics-dimension-repository_nwo | coder/code-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 172953845 |
| octolytics-dimension-repository_network_root_nwo | coder/code-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width