Skip to content

Commit

Permalink
Add install pagespeed
Browse files Browse the repository at this point in the history
  • Loading branch information
extensionsapp committed Apr 29, 2018
1 parent 66aa34c commit 83df881
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 31 deletions.
3 changes: 1 addition & 2 deletions config/default/nginx/bots.d/whitelist-ips.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
188.114.96.0/20 0;
190.93.240.0/20 0;
197.234.240.0/22 0;
198.41.128.0/17 0;
80.85.156.55 1;
198.41.128.0/17 0;
1 change: 1 addition & 0 deletions config/default/nginx/conf.d/blacklist.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7385,6 +7385,7 @@ geo $validate_client {
93.158.200.126 1;
93.158.200.66 1;
93.158.200.68 1;
80.85.156.55 1;
# END BAD IP RANGES ### DO NOT EDIT THIS LINE AT ALL ###
}

Expand Down
35 changes: 6 additions & 29 deletions config/default/nginx/conf.d/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ server {
return 444;
}

location ~ ^/(themes|favicon.ico) {
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {add_header "" "";}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

location ~ ^/(themes|favicon\.ico) {
access_log off;
autoindex off;
expires 30d;
add_header Cache-Control "public, no-transform";
}

location /images {
location /images/ {
rewrite "^\/images\/(poster|picture)\/(medium|small)\/.*img([0-9]+).*\.jpg$" "/$1/$2/$3.jpg" break;
root /var/local/images;
access_log off;
Expand All @@ -65,33 +69,6 @@ server {
rewrite ^/(.*)$ "https://cinemapress.org/article/kak-vzlomat-sayt.html" permanent;
}

location ~* ^/(moonlight|moonplayer)($|\/) {
rewrite "^/moonplayer/face.json$" /moonplayer/parser.php?action=face last;
rewrite "^/moonplayer/master.m3u8$" /moonplayer/parser.php?action=master last;
rewrite "^/moonplayer/source.ts$" /moonplayer/parser.php?action=source last;
rewrite "^/moonplayer/source.m3u8$" /moonplayer/parser.php?action=source last;
rewrite "^/moonplayer/([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/iframe$" /moonplayer/player.php?type=$1&key=$2 last;
rewrite "^/moonplayer/class/(.*)$" / redirect;
rewrite "^/moonplayer/parser/(.*)$" / redirect;
rewrite "^/moonplayer/(.*)\.ini$" / redirect;
rewrite "^/moonplayer/init.js$" /moonplayer/init.php last;
rewrite "^/moonlight(.*)$" /moonlight/app/app.php last;
index index.php index.html index.htm;

location ~ \.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js|ttf)$ {
access_log off;
}

location ~ \.php$ {
try_files $uri = 404;
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
add_header Access-Control-Allow-Origin *;
}
}

location / {
if ($host ~* "^(m\.example.com)$") {
rewrite ^(.*)$ /mobile-version$1 break;
Expand Down
25 changes: 25 additions & 0 deletions config/default/nginx/conf.d/real_ip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set_real_ip_from 186.2.160.0/24;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 186.2.160.0/24;

real_ip_header X-Forwarded-For;
9 changes: 9 additions & 0 deletions themes/default/views/admin/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,15 @@
</div>
<div class="col-sm-4">
<select name="config.index.count.sorting" class="form-control without">
<% if (config.index.count.sorting == '') { %>
<option value="" selected="selected">
По умолчанию
</option>
<% } else { %>
<option value="">
По умолчанию
</option>
<% } %>
<% for (var name in config.sorting) { %>
<% if (config.index.count.sorting == name) { %>
<option value="<%= name %>" selected="selected">
Expand Down

0 comments on commit 83df881

Please sign in to comment.