code-server with proxy_pass

I want to move code-server into www.domain/vscode instead of www.domain here is my current nginx block:
location /code {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
location /code {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
But it doesn't work
4 Replies
Phorcys
Phorcys3y ago
why not code.domain also what do you mean by "doesn't work" I am not sure you will be able to proxy_pass in a subpath
FaeWulf
FaeWulf3y ago
Nevermind it worked after I put additional "/" after "/code"
Phorcys
Phorcys3y ago
undo that and remove the / after the proxy_pass url it's cleaner
FaeWulf
FaeWulf3y ago
Ok
Want results from more Discord servers?
Add your server