提供内部CMS的图像

时间:2017-09-28 07:36:40

标签: nginx

我怎样才能实现nginx从后端提供图像。 如果用户呼叫http://example.com/images/1.jpg,则应从内部CMS提供该图像。我尝试过try_files,proxy_pass等等。但可能我不在轨道上,这是完全错误的做法......

location = /images {
    rewrite /images/(.*) /images/$1 last; 
    proxy_pass http://192.168.0.5:12345/CMS;
}

THX。

1 个答案:

答案 0 :(得分:1)

您需要使用以下

location /images {
    proxy_pass http://192.168.0.5:12345/CMS;
}

=用于绝对网址。现在看它应该有效。