1. 기술 스택

2. 빌드 및 배포

2-1. Jenkins 를 이용한 자동 빌드 및 배포

Untitled

2-2. AWS 서버 Nginx 설정파일

ubuntu@ip-172-26-8-54:/etc/nginx/sites-available$ cat muntopia.com
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# <https://www.nginx.com/resources/wiki/start/>
# <https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/>
# <https://wiki.debian.org/Nginx/DirectoryStructure>
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#

server {
        location / {
                proxy_pass <http://localhost:3000>;
        }

        location /api {
                proxy_pass <http://localhost:8081>;
        }

        location /jenkins {
                rewrite ^ <http://i7d209.p.ssafy.io:9090>;
        }

        #root /jenkins/workspace/mungtopia/frontend/dist;
        #index index.html;

        listen [::]:443 ssl ipv6only=on; # managed by Certbot
        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/i7d209.p.ssafy.io/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/i7d209.p.ssafy.io/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 = i7d209.p.ssafy.io) {
                return 301 https://$host$request_uri;
        } # managed by Certbot

        listen 80;
        listen [::]:80;

        server_name i7d209.p.ssafy.io;
        return 404; # managed by Certbot
}