Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
# Pull Latest Docker Image
sudo docker pull "${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO }}:latest"

# ν™˜κ²½λ³€μˆ˜ μΆ”κ°€
echo "REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }}" > /home/ubuntu/.env
echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> /home/ubuntu/.env
echo "DOCKER_REPO=${{ secrets.DOCKER_REPO }}" >> /home/ubuntu/.env
Expand Down
11 changes: 4 additions & 7 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@ http {
server spring-app:8080; # Spring Boot μ»¨ν…Œμ΄λ„ˆ
}

# HTTP μš”μ²­μ„ ALBμ—μ„œ 받은 ν›„ 처리
server {
listen 80;
# listen 443 ssl;
# server_name
# SSL μΈμ¦μ„œ μ„€μ •
# ssl_certificate /etc/letsencrypt/live/{server_name}/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/{server_name}/privkey.pem;
server_name farmon-be.site;

# 일반 API μš”μ²­ 처리 (Spring Boot ν”„λ‘μ‹œ)
location / {
proxy_pass http://spring-server;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

# WebSocket μš”μ²­ 처리 (/ws-stomp 경둜)
# WebSocket μš”μ²­ 처리
location /ws-stomp {
proxy_pass http://spring-server;
proxy_http_version 1.1;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/backend/farmon/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public OpenAPI FarmONSwagger() {

return new OpenAPI()
.addServersItem(new Server().url("http://localhost:8080")) // 둜컬 μ„œλ²„ URL μ„€μ •
.addServersItem(new Server().url("http://43.201.137.131:8080")) // 배포된 μ„œλ²„ URL
.addServersItem(new Server().url("https://farmon-be.site")) // 배포된 μ„œλ²„ URL (https)
.addServersItem(new Server().url("http://43.201.137.131:8080")) // 배포된 μ„œλ²„ URL (http)
.info(info)
.addSecurityItem(securityRequirement)
.components(components);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/backend/farmon/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class WebConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {

registry.addMapping("/**") // λͺ¨λ“  κ²½λ‘œμ— λŒ€ν•΄ CORS ν—ˆμš©
.allowedOrigins("http://localhost:5173", "http://localhost:8080", "http://43.201.137.131:8080") // ν—ˆμš©ν•  Origin μ„€μ •
.allowedOrigins("http://localhost:5173", "http://localhost:8080", "https://farmon-be.site", "http://43.201.137.131:8080") // ν—ˆμš©ν•  Origin μ„€μ •
.allowedHeaders("*") // μš”μ²­μ„ ν—ˆμš©ν•  헀더 μ„€μ •
.exposedHeaders("*") // 응닡 헀더 μ„€μ •
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS") // ν—ˆμš©ν•  HTTP λ©”μ„œλ“œ λͺ…μ‹œ
Expand Down