Skip to content

Commit

Permalink
[Infra] 배포 스크립트 변경 및 Nginx 수정 (#82)
Browse files Browse the repository at this point in the history
* [Infra] : Nginx 파일 수정

* [Infra] 배포 스크립트 변경
  • Loading branch information
NCOOL060580327 authored Feb 21, 2025
1 parent d51e43a commit cc898b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,4 @@ jobs:
version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
region: ap-northeast-2
deployment_package: Dockerrun.aws.json
wait_for_environment_recovery: 180

- name: SSH into EC2 and install Node Exporter
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
script: |
wget https://github.com/prometheus/node_exporter/releases/download/v1.9.0/node_exporter-1.9.0.linux-amd64.tar.gz
tar xvfz node_exporter-1.9.0.linux-amd64.tar.gz
cd node_exporter-1.9.0.linux-amd64
sudo systemctl start node_exporter
wait_for_environment_recovery: 180
2 changes: 1 addition & 1 deletion .platform/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ http {
}

location /metrics {
proxy_pass http://localhost:9100;
proxy_pass http://127.0.0.1:9100/metrics;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
"/health",
"/kakao/**",
"/api/auth/login",
"/api/auth/testjoin",
"api/auth/testlogin",
"/api/auth/testlogin",
"/actuator/**",
"/metrics/**")
.permitAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;

String requestURI = httpRequest.getRequestURI();
if (requestURI.startsWith("/metrics") || requestURI.startsWith("/actuator")) {
filterChain.doFilter(request, response);
return;
}

// 헤더에서 JWT 토큰을 가져옴
String token = jwtProvider.resolveToken(httpRequest);

Expand Down

0 comments on commit cc898b6

Please sign in to comment.