1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| $ sudo apt install nginx certbot -y $ sudo systemctl stop nginx $ sudo certbot certonly -d jenkins.goreng.cc --register-unsafely-without-email $ sudo vim /etc/nginx/sites-available/jenkins.goreng.cc ... server { listen 443 ssl http2 ipv6only=on; listen [::]:443 ssl http2; server_name jenkins.goreng.cc;
access_log /var/log/nginx/jenkins.access.log; error_log /var/log/nginx/jenkins.error.log;
ssl_certificate /etc/letsencrypt/live/jenkins.goreng.cc/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/jenkins.goreng.cc/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/jenkins.goreng.cc/chain.pem;
location / { include /etc/nginx/proxy_params; proxy_pass http://localhost:8080; proxy_read_timeout 90s; proxy_redirect http://localhost:8080 https://jenkins.goreng.cc.com; } }
server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name *.jenkins.goreng.cc;
ssl_certificate /etc/letsencrypt/live/jenkins.goreng.cc/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/jenkins.goreng.cc/privkey.pem; ssl_trusted_certificate /etc/letsencrypt/live/jenkins.goreng.cc/chain.pem; return 301 https://jenkins.goreng.cc$request_uri; }
server { listen 80; listen [::]:80; server_name .jenkins.goreng.cc;
location / { return 301 https://jenkins.goreng.cc$request_uri; } } ...
$ sudo ln -s /etc/nginx/sites-available/jenkins.goreng.cc /etc/nginx/sites-enabled/ $ sudo systemctl start nginx
|