Jump to content
  • 0

Ngix Direktiven für .webp Bilder


garald7

Question

Guten Abend

Ich bin seit einigen Tagen am rumprobieren.

Mein Hoster bietet an die Ngix Direktiven anzupassen.

Das alle PNG korrekt angezeigt werden.

Die JPG Bilder jedoch werden nicht angezeigt.

Für die Komprimierung hab ich ein Plugin genutzt.

 

Kennt jemand das Problem mit NGIX?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

location ~ "^/{FOLDER}admin(.*?)/" {
    client_max_body_size 100M;
    if (!-e $request_filename) {
        rewrite ^/{FOLDER}admin(.*?)/.*$ /{FOLDER}admin$1/index.php last;
    }
}
location ~ "^/{FOLDER}backoffice(.*?)/" {
    client_max_body_size 100M;
    if (!-e $request_filename) {
        rewrite ^/{FOLDER}backoffice(.*?)/.*$ /{FOLDER}backoffice$1/index.php last;
    }
}

location /{FOLDER} {
    client_max_body_size 100M;

    rewrite ^/{FOLDER}api/?(.*)$ /{FOLDER}webservice/dispatcher.php?url=$1 last;

    try_files $uri $uri/ /{FOLDER}index.php$is_args$args;
    error_page 404 /{FOLDER}index.php?controller=404;

    #location ~ "^/{FOLDER}admin(.*?)/" {
    #    if (!-e $request_filename) {
    #        rewrite ^/{FOLDER}admin(.*?)/.*$ /{FOLDER}admin$1/index.php last;
    #    }
    #}
    
    location ~* \.(gif)$ {
    rewrite ^/{FOLDER}images_ie/?([^/]+)\.(gif)$ /{FOLDER}js/jquery/plugins/fancybox/images/$1.$2 last;
        expires 2592000s;
    }
    location ~* \.(jpeg|jpg)$ {
        rewrite ^/{FOLDER}([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$1$2$3.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$1$2$3$4.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
        rewrite ^/{FOLDER}([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
        rewrite ^/{FOLDER}c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/c/$1$2$3.jpg last;
        rewrite ^/{FOLDER}c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /{FOLDER}img/c/$1$2.jpg last;
        rewrite ^/{FOLDER}images_ie/?([^/]+)\.(jpe?g)$ /{FOLDER}js/jquery/plugins/fancybox/images/$1.$2 last;
        expires 2592000s;
    }
    location ~* \.(png)$ {
        rewrite ^/{FOLDER}images_ie/?([^/]+)\.(png)$ /{FOLDER}js/jquery/plugins/fancybox/images/$1.$2 last;
        expires 2592000s;
    }
    location ~* \.(css)$ {
        expires 604800s;
    }
    location ~* \.(js|jsonp)$ {
        expires 604800s;
    }
    location ~* \.(js)$ {
        expires 604800s;
    }
    location ~* \.(ico)$ {
        expires 31536000s;
    }

        location ~* \.(ttf|ttc|otf|eot|woff|svg)$ {
                add_header Access-Control-Allow-Origin *;
        }
    
    location ~ \.php$ {
        #try_files $uri =404;
                try_files $uri /{FOLDER}index.php$is_args$args;
        include /etc/nginx/fastcgi_params;
        {FASTCGIPASS}
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #fastcgi_param PATH_INFO $fastcgi_script_name;
        #fastcgi_intercept_errors on;
        
        fastcgi_temp_file_write_size 10m;
        fastcgi_busy_buffers_size    512k;
        fastcgi_buffer_size          512k;
        fastcgi_buffers           16 512k;
        fastcgi_read_timeout 1200;
        <tmpl_if name='php' op='==' value='hhvm'>error_page 500 501 502 503 = @phpfallback{FOLDERMD5};</tmpl_if>
        
    }
}

<tmpl_if name='php' op='==' value='hhvm'>
location @phpfallback{FOLDERMD5} {
    client_max_body_size 100M;
    #try_files $uri =404;
        try_files $uri /{FOLDER}index.php$is_args$args;
    include /etc/nginx/fastcgi_params;
    {PHPFALLBACKFASTCGIPASS}
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_intercept_errors on;
        
    fastcgi_temp_file_write_size 10m;
    fastcgi_busy_buffers_size    512k;
    fastcgi_buffer_size          512k;
    fastcgi_buffers           16 512k;
    fastcgi_read_timeout 1200;
}
</tmpl_if>
 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Mal so ne Frage am Rande... Der Hoster weiß, was er tut?

Ich frage nur, weil ich der Ansicht bin, dass ein Hoster seinen Kunden schon eine funktionsfähige Plattform anbieten sollte. Wenn du natürlich einen eigenen Server bzw. VPS hast, dann sieht das schon anders aus, dann ist auch die Konfiguration deine Sache, wenn du diese nicht dazugebucht hast.

Weiter schreibst du hier, ein Plugin genutzt zu haben, woher soll jetzt hier jemand wissen, welches, und warum?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...