我正在尝试在rails 4中使用UTF8路由
get '/документы', to: 'static_pages#docs', as: :docs
它在WEBrick上工作得很好,但在战场上不起作用(nginx +乘客)
我猜是因为nginx使我的网址小写
No route matches [GET] "/%d0%b4%d0%be%d0%ba%d1%83%d0%bc%d0%b5%d0%bd%d1%82%d1%8b"
但是rails希望它是大写的
Started GET "/%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B" for 127.0.0.1
Completed 200 OK in 52ms (Views: 49.0ms | ActiveRecord: 1.0ms)
有没有办法让nginx了解unicode路由?
继承人我的nginx服务器配置
server {
listen 80;
server_name website.com;
charset utf8;
root /web/website/public;
location ~ ^/assets/ {
root /web/website/public;
expires 1y;
add_header Cache-Control public;#
add_header ETag "";
break;
}
error_page 502 404 /502.html;
passenger_enabled on;
rails_spawn_method smart;
rails_env production;
}