Martin_Berlin
New Pleskian
I'm trying to redirect (jpg|jpeg) files in a certain directory (/pdf/) to php to process first end then deliver as image - but all I get is a 404.
That's my configuration:
YES (Intelligente Bearbeitung statischer Dateien)
YES (Statische Dateien direkt durch Nginx bedienen)
ac3 avi bmp bz2 css cue dat doc docx dts exe flv gz htm html img iso mkv mp3 mp4 mpeg mpg ogg ppt pptx qt rar rm swf tar tgz txt wav xls xlsx zip
YES (PHP von Nginx verarbeiten lassen)
Nginx directives:
if ($scheme !~* ^https ){
rewrite ^ https://$server_name$request_uri? permanent;
}
location ~ ^/pdf/(.*)\.(jpg|jpeg|test)$ {
rewrite ^/pdf/(.*)\.(jpg|jpeg|test)$ /pdf/image.php?id=$1 break;
}
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin '*';
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri @fallback;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri @fallback;
}
gzip on;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_proxied any;
gzip_types text/html application/xml+rss application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rdf+xml application/rss+xml application/schema+json application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-javascript application/x-web-app-manifest+json application/xhtml+xml application/xml font/eot font/opentype image/bmp image/svg+xml image/vnd.microsoft.icon image/x-icon text/cache-manifest text/css text/javascript text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy text/xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
THANK YOU
That's my configuration:
YES (Intelligente Bearbeitung statischer Dateien)
YES (Statische Dateien direkt durch Nginx bedienen)
ac3 avi bmp bz2 css cue dat doc docx dts exe flv gz htm html img iso mkv mp3 mp4 mpeg mpg ogg ppt pptx qt rar rm swf tar tgz txt wav xls xlsx zip
YES (PHP von Nginx verarbeiten lassen)
Nginx directives:
if ($scheme !~* ^https ){
rewrite ^ https://$server_name$request_uri? permanent;
}
location ~ ^/pdf/(.*)\.(jpg|jpeg|test)$ {
rewrite ^/pdf/(.*)\.(jpg|jpeg|test)$ /pdf/image.php?id=$1 break;
}
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin '*';
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri @fallback;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
try_files $uri @fallback;
}
gzip on;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_proxied any;
gzip_types text/html application/xml+rss application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rdf+xml application/rss+xml application/schema+json application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-javascript application/x-web-app-manifest+json application/xhtml+xml application/xml font/eot font/opentype image/bmp image/svg+xml image/vnd.microsoft.icon image/x-icon text/cache-manifest text/css text/javascript text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy text/xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
THANK YOU