Welcome! Log In Create A New Profile

Advanced

NGINX - Not Calling Java Based Auth Applicaiton running in Spring Boot

March 30, 2017 01:06AM
Hi,

I am implementing nginx as API gateway. I have two applications written in spring-boot-web with angularjs. One application is which is auth application and has login.html page inside it. The othe is my upstream applicaiton.

My issue is when I comment/disable the /auth part of the below config, my applicaiton becomes accessible via nginx. But, when I enable the auth config in nginx, i start getting http 500 error. I am not getting detailed logs in NGINX so don't know how to send more details in the forum.


Following is my nginx.conf.

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server {
listen 8180;

# web user traffic service
location /adi{
auth_request /auth;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header Host $http_host;

proxy_pass http://adi-backend;
}

location =/auth{
internal;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header Host $http_host;

proxy_pass http://127.0.0.1:8080/;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

error_page 401 = @error401;
error_page 404 = @error401;
location @error401 {
return 302 http://adi-backend;
}

}
upstream adi-backend {
server localhost:8080;
}
}
Subject Author Posted

NGINX - Not Calling Java Based Auth Applicaiton running in Spring Boot

zaidahmd March 30, 2017 01:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready