auto-save 2026-05-15 15:15 (~4)
This commit is contained in:
@@ -4,17 +4,61 @@ server {
|
||||
|
||||
client_max_body_size 2g;
|
||||
|
||||
auth_basic "SKG Marketing Studio";
|
||||
auth_basic_user_file /etc/nginx/auth/.htpasswd;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
|
||||
|
||||
location = /__auth {
|
||||
internal;
|
||||
proxy_pass http://skg-marketing-api:4291/auth/check;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header Cookie $http_cookie;
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location = /api/auth/login {
|
||||
proxy_pass http://skg-marketing-api:4291/auth/login;
|
||||
proxy_http_version 1.1;
|
||||
proxy_request_buffering off;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_connect_timeout 60s;
|
||||
}
|
||||
|
||||
location = /api/auth/logout {
|
||||
proxy_pass http://skg-marketing-api:4291/auth/logout;
|
||||
proxy_http_version 1.1;
|
||||
proxy_request_buffering off;
|
||||
proxy_buffering off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_connect_timeout 60s;
|
||||
}
|
||||
|
||||
location @api_unauthorized {
|
||||
default_type application/json;
|
||||
return 401 '{"error":"unauthorized"}';
|
||||
}
|
||||
|
||||
location = /api {
|
||||
return 308 /api/;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
auth_request /__auth;
|
||||
error_page 401 = @api_unauthorized;
|
||||
proxy_pass http://skg-marketing-api:4291/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_request_buffering off;
|
||||
@@ -28,7 +72,32 @@ server {
|
||||
proxy_connect_timeout 60s;
|
||||
}
|
||||
|
||||
location = /login {
|
||||
return 308 /login/;
|
||||
}
|
||||
|
||||
location /login/ {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /login/index.html;
|
||||
}
|
||||
|
||||
location /_next/ {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location ~* ^/(icon|apple-icon|favicon|manifest|placeholder).* {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location @login_redirect {
|
||||
return 302 /login/;
|
||||
}
|
||||
|
||||
location / {
|
||||
auth_request /__auth;
|
||||
error_page 401 = @login_redirect;
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user