Skip to content

Commit b804560

Browse files
committed
Update nginx config
1 parent 3e445d4 commit b804560

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

nginx/www_app_nginx.conf

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ events {
1515
http {
1616
real_ip_header X-Forwarded-For;
1717
set_real_ip_from 192.0.2.0/24;
18+
real_ip_recursive on;
1819

1920
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
2021
'$status $body_bytes_sent "$http_referer" '
@@ -39,4 +40,4 @@ http {
3940
default_type application/octet-stream;
4041

4142
include /etc/nginx/sites-enabled/*.conf;
42-
}
43+
}

nginx/www_cache_nginx.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ events {
1313
}
1414

1515
http {
16-
real_ip_header X-Forwarded-For;
17-
set_real_ip_from 192.0.2.0/24;
18-
1916
resolver 192.0.2.2;
2017
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
2118
'$status $body_bytes_sent "$http_referer" '
@@ -79,7 +76,10 @@ http {
7976
if ($http_cookie ~* "comment_author_|wordpress_(?!test_cookie)|wp-postpass_" ) {
8077
set $do_not_cache 1;
8178
}
82-
proxy_set_header Host $host;
79+
80+
proxy_set_header Host $host;
81+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
82+
8383
proxy_cache_key "$scheme://$host$request_uri $do_not_cache";
8484
proxy_cache staticfilecache;
8585
proxy_pass http://wordpress;

0 commit comments

Comments
 (0)