PixNyb
PixNyb
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
Including working ssl
157 replies
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
All you have to do now is visit 30.{domain} and log in, then you’ll be able to access your app running on localhost:30
157 replies
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
No that should just work, i have a separate block to allow http on only proxied ports, but this should do the trick if you’re running a web application and want to access it elsewhere with the code-server authentication
157 replies
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
Oh wait this is the domain itself^ I’ll send the proxy thing too
157 replies
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
To access your web application running on localhost:30 you’ll have to configure the proxy in nginx, what i did in my nginx config is listen to anything in the following format: {number}.{domain} and then proxy reverse proxy that to code server (running on localhost:8080). This is what that looks like:
server {
# Update this line to be your domain
server_name {domain};

# Ensure these lines point to your SSL certificate and key
ssl_certificate /etc/letsencrypt/live/{domain}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{domain}/privkey.pem;
# Use these lines instead if you created a self-signed certificate
# ssl_certificate /etc/nginx/ssl/cert.pem;
# ssl_certificate_key /etc/nginx/ssl/key.pem;

# Ensure this line points to your dhparams file
ssl_dhparam /etc/ssl/certs/dhparam.pem;


# These shouldn't need to be changed
listen [::]:443 ssl; # if your nginx version is >= 1.9.5 you can also add the "http2" flag here
add_header Strict-Transport-Security "max-age=0";
# ssl on; # Uncomment if you are using nginx < 1.15.0
ssl_protocols TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;

proxy_buffering off;

location / {
proxy_redirect off;
proxy_pass http://localhost:8080/;

proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
server {
# Update this line to be your domain
server_name {domain};

# Ensure these lines point to your SSL certificate and key
ssl_certificate /etc/letsencrypt/live/{domain}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{domain}/privkey.pem;
# Use these lines instead if you created a self-signed certificate
# ssl_certificate /etc/nginx/ssl/cert.pem;
# ssl_certificate_key /etc/nginx/ssl/key.pem;

# Ensure this line points to your dhparams file
ssl_dhparam /etc/ssl/certs/dhparam.pem;


# These shouldn't need to be changed
listen [::]:443 ssl; # if your nginx version is >= 1.9.5 you can also add the "http2" flag here
add_header Strict-Transport-Security "max-age=0";
# ssl on; # Uncomment if you are using nginx < 1.15.0
ssl_protocols TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;

proxy_buffering off;

location / {
proxy_redirect off;
proxy_pass http://localhost:8080/;

proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
157 replies
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
So basically what i did was run code-server on any port that’s not in use by my server, which was 8080 by default. I updated the code-server config to the following:
proxy-domain: {domain}
bind-addr: 127.0.0.1:8080
auth: password
cert: false
proxy-domain: {domain}
bind-addr: 127.0.0.1:8080
auth: password
cert: false
The proxy-domain is what ultimately got code-server to listen to my public domain. I didn’t set up code-server to use certs because i already did that with nginx, which works just fine
157 replies
CCoder.com
Created by viking on 10/4/2022 in #help
How can I setup an SSL?
I’m running code-server with nginx too, i might be of some assistance
157 replies