Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

  • 80 port(Http) 통신만 사용

  • 80(Http) & 443(https)을 동시에 사용

  • [Recommend] https만 사용, 80(http)포트 접속시 443(https)으로 redirect 설정

    • https가 보안 및 http2 적용시 병렬처리 가능하여 성능 개선

...

Expand
titlejenkins.conf
Code Block
server {
    listen       80;
    listen       443;
    server_name  api.justten.io;
    charset utf-8;
    rewrite_log  on;
    client_max_body_size 50M;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-Proto http;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_connect_timeout 300;
        proxy_send_timeout 300;
        proxy_read_timeout 300;
        send_timeout 300;
    }

    if ($http_x_forwarded_proto = "http") {
        return    301 https://$server_name$request_uri;
    }

}

...

Http2 적용

Attach http2 on config file(path: /home/ec2-user/nginx/conf.d/jenkins.conf/)

서버내 인증서가 있는경우: listem 443 ssl http2

AWS ACM 사용시: listen 443 http2

...

설정 여부 확인

https://tools.keycdn.com/http2-test

...

Reference

Install Http2 as a nginx latest version

https://ma.ttias.be/enable-http2-in-nginx/

HTTP/1.1 vs HTTP/2 비교

https://www.digitalocean.com/community/tutorials/http-1-1-vs-http-2-what-s-the-difference