mirror of
https://github.com/insistence/RuoYi-Vue3-FastAPI.git
synced 2026-10-07 18:30:56 +00:00
* feat: 新增统一认证中心 * perf: 优化代码 * fix: 修复问题 * perf: 优化页面 * fix: 修复部分接口缺失Request参数的问题 * perf: 优化访问控制机制 * perf: 优化代码 * fix: 修复 Logout Token 缺少 exp * perf&fix: 优化和修复 * perf: 优化代码 * perf: 优化代码 * fix: 修复测试问题
44 lines
1.7 KiB
Plaintext
44 lines
1.7 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
location / {
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# 认证交互页面包含登录和授权信息,禁止缓存、嵌入和跨站引用。
|
|
location ^~ /auth-center/ {
|
|
root /usr/share/nginx/html;
|
|
try_files /index.html =404;
|
|
add_header Cache-Control "no-store" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
}
|
|
|
|
# API代理配置(PostgreSQL版本)
|
|
location /docker-api/ {
|
|
proxy_pass http://ruoyi-backend-pg:9099/;
|
|
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;
|
|
}
|
|
|
|
# 认证中心标准端点和交互 API 必须与 issuer、认证页面保持同源根路径。
|
|
location ~ ^/(\.well-known/|oauth2/|auth/interaction/) {
|
|
proxy_pass http://ruoyi-backend-pg:9099;
|
|
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;
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|