Problem with Leverage browser caching setup

Pain187

New Member
YetiShare User
Mar 16, 2016
13
0
0
35
Jeddah
upani.net
Hello There,

I'm trying to setup Leverage browser caching in Nginx but when i try that i'm getting all files thumbnails as a broken picture.



i'm trying to use this command:

Code:
	location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2?|rar|swf|woff)$ { expires 7d; }
Please can you help me to resolve this issue. to get better result. :(
 

Attachments

donnywahyudi874705

New Member
YetiShare User
Jan 31, 2015
13
0
1
Post your full nginx configuration here, including php section..so we can help you out.

I'm using the same config as yours but mine is fine.
 

Pain187

New Member
YetiShare User
Mar 16, 2016
13
0
0
35
Jeddah
upani.net
This is my configuration below:

Code:
server {
    listen      *******:443 ssl http2;
    server_name ***** *****;
	add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
	root        /root/site/web/domain/public_html;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/domain.log combined;
    access_log  /var/log/nginx/domains/domain.bytes bytes;
    error_log   /var/log/nginx/domains/domain.error.log error;
    client_max_body_size 6G;
	gzip  on;
	gzip_http_version 1.1;
	gzip_vary on;
	gzip_comp_level 6;
	gzip_proxied any;
	gzip_types text/plain text/css application/json \application/x-javascript text/xml application/xml \application/xml+rss text/javascript application/javascript \text/x-js;
	gzip_buffers 16 8k;
	gzip_disable "MSIE [1-6]\.(?!.*SV1)";
	
    ssl         on;
    ssl_certificate      ssl-bundle.crt;
    ssl_certificate_key  ssl.****.key;
	

# nginx webdav rules
# allow for paths ending with forward slashes
rewrite ^/app/(.*)/ /plugins/webdav/site/control/$1 last;
rewrite ^/app/(.*) /plugins/webdav/site/control/$1 last;
# all webdav requests
location /plugins/webdav/site/control/ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    gzip off;
    fastcgi_pass   127.0.0.1:9001;
    fastcgi_index  index.php;
    include        fastcgi_params;
	add_header Cache-Control public;
    fastcgi_hide_header Set-Cookie;
}

	location ~* ^.+\.(png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2?|rar|swf|woff)$ { expires 7d; }


    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        if (!-e $request_filename) { rewrite ^/(.*) /index.php?_page_url=$1 last; }
        fastcgi_pass   127.0.0.1:9001;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    location / {
		if (!-e $request_filename) {
			rewrite ^/(.*) /index.php?_page_url=$1 last;
		}
    }

    location /files/ {
        internal;
    }

    include     /etc/nginx/conf.d/p*;
    include     /etc/nginx/conf.d/p*;
    include     /etc/nginx/conf.d/w*;

    include     /root/name/conf/web/nginx.domain.conf*;
}
 

donnywahyudi874705

New Member
YetiShare User
Jan 31, 2015
13
0
1
try set php.ini to allow remote url include

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = On