why do i get redirected to /login?

hey guys. i have java spring app. it has this websecurity config chain:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/sol/createPaymentInformation").permitAll()
.antMatchers("/sol/createPaymentConfirmation").permitAll()
.antMatchers("/sol/createPaymentReversal").permitAll()
.anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll()
.and().logout().permitAll()
.and().csrf().disable();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/sol/createPaymentInformation").permitAll()
.antMatchers("/sol/createPaymentConfirmation").permitAll()
.antMatchers("/sol/createPaymentReversal").permitAll()
.anyRequest().authenticated()
.and().formLogin().loginPage("/login").permitAll()
.and().logout().permitAll()
.and().csrf().disable();
}
1. when i launch my app on computer, my endpoints are called fine. 2. when i deploy my app to the server, the endpoints arent being called - i get 404 i have nginx on the server. i opened nginx access log:
"POST /bgw/sol/createPaymentInformation HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0"
"GET /login HTTP/1.1" 404 146 "http://myserver.lv/bgw/sol/createPaymentInformation" "PostmanRuntime/7.43.0"
"POST /bgw/sol/createPaymentInformation HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0"
"GET /login HTTP/1.1" 404 146 "http://myserver.lv/bgw/sol/createPaymentInformation" "PostmanRuntime/7.43.0"
i dont understand why its being redirected to /login. can smb help me out? as i understand its smth with nginx, not the java app itself.
7 Replies
JavaBot
JavaBot12h ago
This post has been reserved for your question.
Hey @Fragmented friends! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st12h ago
Does nginx actually forward the requests to the server? How is it deployed? What is redirected to /login? I only see 404s
i hate SQL so much its unreal
when you said How is it deployed? what is it?
dan1st
dan1st11h ago
the application
i hate SQL so much its unreal
its jar file
dan1st
dan1st11h ago
Check whether nginx actually forwards the requests and where
i hate SQL so much its unreal
you mean this? "POST /bgw/sol/createPaymentInformation HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0" "GET /login HTTP/1.1" 404 146 "http://myserver.lv/bgw/sol/createPaymentInformation" "PostmanRuntime/7.43.0"

Did you find this page helpful?