41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name accounts.svc.plus;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name accounts.svc.plus;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/svc.plus/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/svc.plus/privkey.pem;
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
|
|
location ^~ /api/auth/ {
|
|
proxy_pass http://account:8080;
|
|
proxy_http_version 1.1;
|
|
|
|
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;
|
|
|
|
add_header Access-Control-Allow-Origin $cors_origin always;
|
|
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" always;
|
|
add_header Access-Control-Allow-Headers "Authorization, Content-Type, Cookie" always;
|
|
add_header Access-Control-Allow-Credentials "true" always;
|
|
|
|
if ($request_method = OPTIONS) {
|
|
return 204;
|
|
}
|
|
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
|
|
add_header Pragma "no-cache";
|
|
add_header Expires "0";
|
|
|
|
proxy_cookie_path / "/; Secure; HttpOnly; SameSite=None";
|
|
}
|
|
}
|