我需要将请求从旧网站重定向到新网站,但需要使用URI的一部分进行重定向。我需要解析现有的URI,以获取“ company”并将其传递到新URI的末尾 旧版:https://olddomain.com/applicationhome/applicationHome.html?sponsor=company 新增:https://www.newdomain.com/webhome/sponsor/company
此nginx.conf配置有什么问题?
server {
listen <%= ENV["PORT"] %>;
server_name local_host;
location / {
root <%= ENV["APP_ROOT"] %>/public;
<% if File.exists?(File.join(ENV["APP_ROOT"], "nginx/conf/.enable_pushstate")) %>
if (!-e $request_filename) {
rewrite ^(.*)$ / break;
}
<% end %>
index index.html index.htm Default.htm;}
location /applicationhome/applicationHome.html {
rewrite ^/webhome/applicationHome.html?sponsor=(.*)$ https://www.newdomain.com/webhome/sponsor/$1 permanent;
}
}