Use X-Accel-Redirect in log.php output

This commit is contained in:
Daniel Winzen
2017-12-03 12:48:37 +01:00
parent 99ccbdccfe
commit a9fd1b658c
3 changed files with 11 additions and 8 deletions

View File

@ -66,7 +66,7 @@ http {
gzip_vary on; gzip_vary on;
gzip_proxied any; gzip_proxied any;
gzip_comp_level 9; gzip_comp_level 6;
# gzip_buffers 16 8k; # gzip_buffers 16 8k;
# gzip_http_version 1.1; # gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;

View File

@ -2,13 +2,13 @@ server {
listen 80 default_server; listen 80 default_server;
root /var/www/html; root /var/www/html;
index index.php; index index.php;
server_name dhosting4okcs22v.onion; server_name dhosting4okcs22v.onion *.dhosting4okcs22v.onion;
location / { location / {
try_files $uri $uri/ =404; try_files $uri $uri/ =404;
} location ~ \.php$ {
location ~ \.php$ { include snippets/fastcgi-php.conf;
include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; }
} }
location /squirrelmail { location /squirrelmail {
location ~ \.php$ { location ~ \.php$ {
@ -33,4 +33,8 @@ server {
location /externals/jush/ { location /externals/jush/ {
root /usr/share/adminer; root /usr/share/adminer;
} }
location /nginx/ {
root /var/log/;
internal;
}
} }

View File

@ -23,6 +23,5 @@ header('Pragma: no-cache');
header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0'); header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0');
header('Expires: 0'); header('Expires: 0');
if(file_exists("/var/log/nginx/{$type}_$user[onion].onion.log$old")){ if(file_exists("/var/log/nginx/{$type}_$user[onion].onion.log$old")){
readfile("/var/log/nginx/{$type}_$user[onion].onion.log$old"); header("X-Accel-Redirect: /nginx/{$type}_$user[onion].onion.log$old");
} }
?>