docker run -itd --name jenkins -p 8081:8080 jenkins/jenkins:lts-jdk17
로 Jenkins 설치sudo ufw allow 8081
sudo ufw enable
→ y 선택/etc/nginx/conf.d/default.conf
수정server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name j10a708.p.ssafy.io;
# SSL setting
ssl_certificate /etc/ssl/j10a708.p.ssafy.io/certificate.crt;
ssl_certificate_key /etc/ssl/j10a708.p.ssafy.io/private.key;
# redirect HTTP request to HTTPS request
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
#access_log /var/log/nginx/host.access.log main;
#error_log /var/log/nginx/host.error.log;
location /.well-known/pki-validation/ {
alias /usr/share/nginx/html/.well-known/pki-validation/;
}
include /etc/nginx/conf.d/service-url.inc;
location / {
resolver 1.1.1.1;
proxy_pass $service_url;
#root /usr/share/nginx/html;
proxy_redirect off;
#index index.html index.htm;
charset utf-8;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
service-url.inc
추가
docker exec -it nginx /bin/bash
vim /etc/nginx/conf.d/service-url.inc
내용 추가
set $service_url http://j10a708.p.ssafy.io:8081;
nginx 재시작