I have a react application that is deployed on NGINX running on 9000 port successfully.
Then I have my spring boot war file deployed on tomcat server 9xx on port 8081.
And I have already enabled/added global cors in spring boot but still facing this issue.
As I have analysed I am not getting any response headers back from the server.
In spring boot main class I have added this
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedHeaders("*").allowedMethods("*").allowedOrigins("http://localhost:9000").allowCredentials(true);
}
};
}
And allowed from http://localhost:9000 server
Request from browser fails with cors error, in this my preflight request is successful
As my spring boot deployed on 8081
I know this question has been asked a lot, but I am stuck at it from last 7 to 8 hours.