Welcome! Log In Create A New Profile

Advanced

How to config nginx with attached diagram

Posted by ilya.iz 
How to config nginx with attached diagram
October 28, 2014 05:18AM
How to create correct config using attached diagram?

This config cant get file from folder imagetest2 for files stored 'as is', only with rewrite rule.

server {
listen *:80;
server_name imagestest.local;
root /var/www/imagestest;

set $other_dir "/var/www/imagestest2";

location ~ / {
try_files $uri $other_dir @rewrite;
}

#try for splitted
location @rewrite {
rewrite "^/(.*)\/([0-9]{1,3})\/(.*)" "/$1/0/0/0/$2/$3" break; #1-3
root $other_dir;
error_page 404 = @fetch_image;
}

location @fetch_image {
rewrite ^(.*)$ http://somehost$request_uri permanent;
}
}

Link to diagram http://tinypic.com/r/28wgif5/8 (forum.nginx.org files seems to be not working)



Edited 1 time(s). Last edit at 10/28/2014 05:24AM by ilya.iz.
Attachments:
open | download - diagram.png (17.3 KB)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 126
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready