Skip to content

Commit

Permalink
perf: 移除 X-Real-IP
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Dec 16, 2023
1 parent f877e46 commit 3903815
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
10 changes: 1 addition & 9 deletions allinone/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ http {
proxy_cache_valid 200 302 720m;
proxy_cache_valid 404 1m;
proxy_cache_use_stale http_502;
proxy_set_header X-Real-IP $remote_addr;
add_header X-Via $server_addr;

client_max_body_size 4096m; # 录像及文件上传大小限制

Expand All @@ -63,7 +61,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -74,7 +71,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -85,7 +81,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -96,7 +91,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -106,13 +100,11 @@ http {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/(core|api|media)/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080;
}
Expand Down
8 changes: 0 additions & 8 deletions web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ http {
proxy_cache_valid 200 302 720m;
proxy_cache_valid 404 1m;
proxy_cache_use_stale http_502;
proxy_set_header X-Real-IP $remote_addr;
add_header X-Via $server_addr;

client_max_body_size 4096m; # 录像及文件上传大小限制

Expand All @@ -63,7 +61,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -74,7 +71,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -85,7 +81,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -96,7 +91,6 @@ http {
proxy_request_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Expand All @@ -106,12 +100,10 @@ http {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ ^/(core|api|media)/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://core:8080;
Expand Down

0 comments on commit 3903815

Please sign in to comment.