Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
http {
...
...
proxy_cache_path /var/cache/nginx/[B]one[/B] levels=1:2 keys_zone=[B]one[/B]:16m max_size=512m inactive=7d;
proxy_cache_key "$scheme$host$request_uri";
...
...
location / {
proxy_pass http://IP:PORT;
proxy_redirect http://HOST:PORT/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache [B]one[/B];
proxy_cache_valid 200 302 7d;
proxy_cache_valid 404 1m;
...
}
proxy_cache_path /var/cache/nginx/one levels=1:2 keys_zone=one:16m inactive=7d max_size=512m;
proxy_temp_path /var/cache/nginx/temp 1 2;
proxy_cache_min_uses 1;
proxy_ignore_client_abort on;
limit_zone slimits $binary_remote_addr 5m;
server {
listen 80;
server_name xxx.com www.xxx.com;
proxy_temp_path /var/cache/nginx/xxx.com 1 2;
location @nocached {
proxy_pass http://xx.xx.xx.xx:8080;
proxy_redirect http://xxx.com:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
limit_conn slimits 10;
proxy_pass http://xx.xx.xx.xx:8080;
proxy_redirect http://xxx.com:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
if ($cookie_dle_user_id) { return 412;}
if ($cookie_dle_password) { return 412;}
if ($request_method = POST ) { return 412;}
error_page 412 = @nocached;
proxy_cache one;
proxy_cache_key "$request_method|$is_args|$host|$request_uri";
proxy_hide_header "Set-Cookie";
proxy_ignore_headers "Cache-Control" "Expires";
proxy_cache_valid 200 302 304 5m;
proxy_cache_valid 301 1h;
proxy_cache_valid 503 4s;
proxy_cache_valid any 1m;
proxy_cache_use_stale http_502 http_503 http_504;
}
location ~ (admin\.php|index\.php\?action=logout) {
proxy_pass http://xx.xx.xx.xx:8080;
proxy_redirect http://xxx.com:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|htm|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$
{
root /var/www/kpromo/data/www/xxx.com;
expires 1y;
access_log off;
error_page 404 = @fallback;
}
location @fallback
{
proxy_pass http://xx.xx.xx.xx:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}