My backend is available at localhost:8080/backend. Authorization works in it.
For the front, the backend is available via the proxy “/server”.
server {
listen 80;
server_name _;
client_max_body_size 25M;
location /server {
proxy_pass http://localhost:8080/backend;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
proxy_cookie_path ~*^/.* /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
}
location / {
root /opt/front;
autoindex on;
gzip_static on;
etag on;
add_header Cache-Control "private, max-age=120";
try_files $uri $uri/ /index.html;
}
error_log /var/log/nginx/front_error.log warn;
access_log /var/log/nginx/front_access.log combined;
}
For example, I logged in to localhost:8080/backend/sso/login . But in localhost/server/sso/login, you need to log in again. And it looks incorrect, because after authorization, there is a redirect to localhost/backend/sso/login, but this is not the correct address.