feat: Successfully issue Let's Encrypt SSL and configure remote.jkwoo.com HTTPS/WSS
This commit is contained in:
@@ -1,34 +1,18 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name remote.jkwoo.com;
|
server_name remote.jkwoo.com;
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
server_name remote.jkwoo.com;
|
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/jkwoo.com-0001/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/letsencrypt/live/jkwoo.com-0001/privkey.pem;
|
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_prefer_server_ciphers on;
|
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
||||||
|
|
||||||
client_max_body_size 500M;
|
client_max_body_size 500M;
|
||||||
proxy_read_timeout 3600s;
|
proxy_read_timeout 3600s;
|
||||||
proxy_send_timeout 3600s;
|
proxy_send_timeout 3600s;
|
||||||
proxy_connect_timeout 60s;
|
proxy_connect_timeout 60s;
|
||||||
|
|
||||||
# HELIOS Webview Viewer GUI & Dashboard
|
# HELIOS Webview Viewer GUI & Dashboard (Port 8085)
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:8085;
|
proxy_pass http://127.0.0.1:8085;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
# WebSocket Secure (wss://) Upgrade Headers
|
# WebSocket Secure (wss://) Upgrade Headers
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
@@ -36,12 +20,30 @@ server {
|
|||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
}
|
}
|
||||||
|
|
||||||
# HELIOS Control Plane API Server
|
# HELIOS Control Plane API Server (Port 3000)
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://127.0.0.1:3000/;
|
proxy_pass http://127.0.0.1:3000/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto https;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listen [::]:443 ssl; # managed by Certbot
|
||||||
|
listen 443 ssl; # managed by Certbot
|
||||||
|
ssl_certificate /etc/letsencrypt/live/remote.jkwoo.com/fullchain.pem; # managed by Certbot
|
||||||
|
ssl_certificate_key /etc/letsencrypt/live/remote.jkwoo.com/privkey.pem; # managed by Certbot
|
||||||
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||||
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
if ($host = remote.jkwoo.com) {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
} # managed by Certbot
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name remote.jkwoo.com;
|
||||||
|
return 404; # managed by Certbot
|
||||||
}
|
}
|
||||||
|
|||||||
15
nginx/setup_certbot.sh
Executable file
15
nginx/setup_certbot.sh
Executable file
@@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "=== Issuing Let's Encrypt SSL Certificate for remote.jkwoo.com ==="
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
echo "Running certbot with sudo..."
|
||||||
|
sudo certbot --nginx -d remote.jkwoo.com --non-interactive --agree-tos --register-unsafely-without-email || sudo certbot --nginx -d remote.jkwoo.com
|
||||||
|
else
|
||||||
|
certbot --nginx -d remote.jkwoo.com --non-interactive --agree-tos --register-unsafely-without-email || certbot --nginx -d remote.jkwoo.com
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=========================================================="
|
||||||
|
echo "✅ SSL Certificate issued and remote.jkwoo.com NGINX configured!"
|
||||||
|
echo "👉 Access URL: https://remote.jkwoo.com"
|
||||||
|
echo "=========================================================="
|
||||||
Reference in New Issue
Block a user