[Jenkins] 젠킨스 초기 설정

탱귤생귤·2024년 4월 21일
0

Infra

목록 보기
4/7
  1. GitLab에서 Access Token 받음
  2. docker run -itd --name jenkins -p 8081:8080 jenkins/jenkins:lts-jdk17 로 Jenkins 설치
    1. 처음에는 9000으로 했는데 뭘해도 안돼서 여쭤보니까 싸피 자체에서 9000포트를 막았다고 한다…^^
  3. ufw 8081허용해주기
    1. sudo ufw allow 8081
    2. sudo ufw enable → y 선택
  4. /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;
    }
}
  1. service-url.inc 추가

    docker exec -it nginx /bin/bash
    vim /etc/nginx/conf.d/service-url.inc
  2. 내용 추가

    set $service_url http://j10a708.p.ssafy.io:8081;
  3. nginx 재시작

0개의 댓글