|
1 | | -## Version 2022/09/08 |
| 1 | +## Version 2022/12/03 |
2 | 2 | # 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` |
3 | 6 |
|
4 | 7 | server { |
5 | 8 | listen 443 ssl; |
@@ -73,3 +76,39 @@ server { |
73 | 76 |
|
74 | 77 | } |
75 | 78 | } |
| 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