Skip to content

Commit

Permalink
update: 后台背景色
Browse files Browse the repository at this point in the history
  • Loading branch information
LinMoQC committed May 6, 2024
1 parent 565a354 commit 6229a83
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 80 http2; # 启用HTTP/2
listen 80;

gzip on;
gzip_min_length 1k;
Expand All @@ -22,22 +22,13 @@ server {
location /api/ {
# 此处为后端地址
proxy_pass ${BACK_API};
# 添加一些安全设置
include proxy_params;
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 X-Content-Type-Options "nosniff";
add_header X-Frame-Options "SAMEORIGIN";
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; frame-ancestors 'none';";

# 限制请求频率
limit_req zone=api burst=5 nodelay;
limit_req_status 429; # 限制请求超过后的响应码

# 防止服务隐藏文件
location ~ /\. {
deny all;
Expand Down

0 comments on commit 6229a83

Please sign in to comment.