D
D
Denis2016-04-04 18:18:22
Nginx
Denis, 2016-04-04 18:18:22

How to redirect from a local folder to another resource on the Internet?

There is a server server with the folder /images ------ server/images All images were
transferred to kartinki.ru/images Sysoeva I.:

location ^~ /images {
  rewrite ^(.*)$ http://kartinki.ru/images redirect;
}

In this case, it seems to work, but it simply transfers to the kartinki.ru/images folder with a 403 error . a request comes in kartinki.ru/images/789456.png , but redirects to kartinki.ru/images with a 403 error. The file itself --- 789456.png is both there and here.
Tried it like this:
location /images/ {
    alias http://kartinki.ru/images/;
}

Nothing happens

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-04-05
@Rentable

Maybe so?
location /images/ {
rewrite ^/images/(.*)$ kartinki.ru/images/$1 permanent;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question