-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,26 +78,26 @@ jobs: | |
- name: create remote directory | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST_PROD }} | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ubuntu | ||
key: ${{ secrets.KEY_PROD }} | ||
key: ${{ secrets.KEY_DEV }} | ||
script: mkdir -p ~/srv/ubuntu/gifty-prod | ||
|
||
- name: copy source via ssh key | ||
uses: burnett01/[email protected] | ||
with: | ||
switches: -avzr --delete | ||
remote_path: ~/srv/ubuntu/gifty-prod | ||
remote_host: ${{ secrets.HOST_PROD }} | ||
remote_host: ${{ secrets.HOST_DEV }} | ||
remote_user: ubuntu | ||
remote_key: ${{ secrets.KEY_PROD }} | ||
remote_key: ${{ secrets.KEY_DEV }} | ||
|
||
- name: executing remote ssh commands using password | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST_PROD }} | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ubuntu | ||
key: ${{ secrets.KEY_PROD }} | ||
key: ${{ secrets.KEY_DEV }} | ||
script: | | ||
sh ~/srv/ubuntu/gifty-prod/config/scripts/deploy.sh | ||
sudo docker stop backend-prod | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,46 @@ | ||
server { | ||
listen 80; | ||
server_name giftyyy.shop www.giftyyy.shop; | ||
return 301 https://$host$request_uri; # http로 들어오면 https로 redirect 해주는 부분 | ||
# 사용자 정의 nginx.conf 파일 | ||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
server_name giftyyy.shop www.giftyyy.shop; | ||
# Certificate | ||
ssl_certificate /etc/letsencrypt/live/giftyyy.shop/fullchain.pem; | ||
# Private Key | ||
ssl_certificate_key /etc/letsencrypt/live/giftyyy.shop/privkey.pem; | ||
|
||
location / { | ||
proxy_pass http://backend-dev:8080; # 자신의 springboot app이 사용하는 포트 | ||
|
||
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; | ||
http { | ||
# MIME 타입 설정 | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
# 로그 설정 | ||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
error_log /var/log/nginx/error.log warn; | ||
|
||
# SSL 설정을 여기에 추가할 수 있음 (예: ssl_protocols, ssl_ciphers 등) | ||
|
||
# HTTP 요청을 HTTPS로 리다이렉트 | ||
server { | ||
listen 80; | ||
server_name zenefit.shop www.zenefit.shop; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
# HTTPS 서버 구성 | ||
server { | ||
listen 443 ssl; | ||
server_name zenefit.shop www.zenefit.shop; | ||
|
||
# SSL 인증서 설정 | ||
ssl_certificate /etc/letsencrypt/live/zenefit.shop/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/zenefit.shop/privkey.pem; | ||
|
||
# Spring Boot 애플리케이션으로의 프록시 | ||
location / { | ||
proxy_pass http://backend-prod:8081; | ||
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters