-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
virtual_proxied_host.conf
64 lines (55 loc) · 2.26 KB
/
virtual_proxied_host.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# limit_conn ip_zone 64;
# limit_conn ip_uri_zone 16;
# limit_req zone=ip_flood burst=256 nodelay;
# limit_req zone=ip_uri_flood burst=64 nodelay;
# autoindex off;
# Force HTTPS
# if ($scheme ~* ^(?!https).*$) {
# return 301 https://$host$request_uri;
# }
# Force www.site.com => site.com
# if ($host ~* ^www\.(.+)$) {
# return 301 $scheme://$1$request_uri;
# }
# Disable access to hidden files and foldersfff
# location ~* /\.(?!well-known/) {
# deny all;
# }
# Disable access to backup, config, command and log files
# location ~* (?:\.(?:bak|co?nf(ig)?|in[ci]|log|sh|sql|tar|t?gz)|~)$ {
# deny all;
# }
# Disable $query_string
# if ($query_string != '') {
# return 301 https://$host$request_uri_path;
# }
location / {
try_files $uri $uri/ @apache;
# try_files $uri $uri/ /index.php$is_args$args;
}
location ~ [^/]\.php(/|$) {
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_pass http://$php_server:80;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Country-Code $geoip2_data_country_code;
# proxy_set_header X-Country-Name $geoip2_data_country_name;
}
location @apache {
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_pass http://$php_server:80;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Country-Code $geoip2_data_country_code;
# proxy_set_header X-Country-Name $geoip2_data_country_name;
}