Skip to content

Commit 1d05e4e

Browse files
committed
add https support for internal openvscode-server port
1 parent fde4486 commit 1d05e4e

1 file changed

Lines changed: 40 additions & 1 deletion

File tree

openvscode-server.subdomain.conf.sample

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
## Version 2022/09/08
1+
## Version 2022/12/03
22
# make sure that your dns has a cname set for openvscode-server
3+
# This conf allows accessing internal ports at `PORT` (http) or `PORTs` (https) as subdomain
4+
# Access http port 8080 at `https://8080.openvscode-server.domain.url`
5+
# Access https port 8080 at `https://8080s.openvscode-server.domain.url`
36

47
server {
58
listen 443 ssl;
@@ -73,3 +76,39 @@ server {
7376

7477
}
7578
}
79+
80+
server {
81+
listen 443 ssl;
82+
listen [::]:443 ssl;
83+
84+
server_name "~^(?<upstream_port>[0-9]{1,10})s\.openvscode-server\..*$";
85+
86+
include /config/nginx/ssl.conf;
87+
88+
client_max_body_size 0;
89+
90+
# enable for ldap auth (requires ldap-location.conf in the location block)
91+
#include /config/nginx/ldap-server.conf;
92+
93+
# enable for Authelia (requires authelia-location.conf in the location block)
94+
#include /config/nginx/authelia-server.conf;
95+
96+
location / {
97+
# enable the next two lines for http auth
98+
#auth_basic "Restricted";
99+
#auth_basic_user_file /config/nginx/.htpasswd;
100+
101+
# enable for ldap auth (requires ldap-server.conf in the server block)
102+
#include /config/nginx/ldap-location.conf;
103+
104+
# enable for Authelia (requires authelia-server.conf in the server block)
105+
#include /config/nginx/authelia-location.conf;
106+
107+
include /config/nginx/proxy.conf;
108+
include /config/nginx/resolver.conf;
109+
set $upstream_app openvscode-server;
110+
set $upstream_proto https;
111+
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
112+
113+
}
114+
}

0 commit comments

Comments
 (0)