diff --git a/nginx/conf.d/prod.conf b/nginx/conf.d/prod.conf index dd209643..6630299d 100644 --- a/nginx/conf.d/prod.conf +++ b/nginx/conf.d/prod.conf @@ -1,6 +1,6 @@ server { listen 80; - server_name cockple.store; + server_name api.cockple.store; location /ws/ { proxy_pass http://cockple-app:8080; diff --git a/src/main/java/umc/cockple/demo/global/config/SecurityConfig.java b/src/main/java/umc/cockple/demo/global/config/SecurityConfig.java index 433fd7b4..d6b0a657 100644 --- a/src/main/java/umc/cockple/demo/global/config/SecurityConfig.java +++ b/src/main/java/umc/cockple/demo/global/config/SecurityConfig.java @@ -66,7 +66,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration config = new CorsConfiguration(); - config.setAllowedOrigins(List.of("http://localhost:5173", "https://cockple.store", "https://staging.cockple.store", "https://cockple-fe.vercel.app")); // 배포 시에는 도메인 지정 권장 + config.setAllowedOrigins(List.of("http://localhost:5173", "https://cockple.store", "https://www.cockple.store", "https://staging.cockple.store", "https://cockple-fe.vercel.app")); // 배포 시에는 도메인 지정 권장 config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); config.setAllowedHeaders(List.of("*")); config.setAllowCredentials(true); diff --git a/src/main/java/umc/cockple/demo/global/config/WebSocketConfig.java b/src/main/java/umc/cockple/demo/global/config/WebSocketConfig.java index aea6747b..94e99a84 100644 --- a/src/main/java/umc/cockple/demo/global/config/WebSocketConfig.java +++ b/src/main/java/umc/cockple/demo/global/config/WebSocketConfig.java @@ -21,7 +21,7 @@ public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { registry .addHandler(chatWebSocketHandler, "/ws/chats") .addInterceptors(jwtWebSocketAuthInterceptor) - .setAllowedOrigins("http://localhost:5173", "https://cockple.store", "https://cockple-fe.vercel.app/", "https://staging.cockple.store") + .setAllowedOrigins("http://localhost:5173", "https://cockple.store", "https://www.cockple.store", "https://cockple-fe.vercel.app/", "https://staging.cockple.store") .withSockJS(); // 브라우저 호환성 } }