upstream myapp{
server unix:/tmp/unicorn.hmp.sock;
#server unix:/tmp/unicorn.rhea.sock;
#server 192.168.1.7:9000;
}
server {
listen 80;
server_name hmp;
client_max_body_size 4G;
client_body_buffer_size 20M;
access_log /home/hmpuser/deploy/shared/log/access.log;
error_log /home/hmpuser/deploy/shared/log/error.log;
root /home/hmpuser/deploy/current;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby{
proxy_pass http://myapp;
}
}
#2 楼 @kennyworld 解决了 谢谢
你能不能写一个简单的例子 我用的 rails 4.0
我现在也用到了 PDFKit 遇到了些许问题 which wkhtmltopdf
/usr/local/bin/wkhtmltopdf
config/initializers/pdfkit.rb
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
剩余的和你一样 在路径加上".pdf"后不能显示任何东西。
uri = URI.parse(http://166.111.138.220:3000/patients/19)
@response=Net::HTTP.post_form(uri, { '_method' => 'delete'})
已解决 3Q
好的、、我试试、、3Q
在 google 下面 确定是 ajax 提交的、、换成 火狐以后 就不是 ajax 提交的了、、这个怎么解决啊?
<script>
$(document).ready(function(){
$('#tt').click(function(){
alert("begin");
event.preventDefault();
$.ajax({
type: "post",
url:'/sessions',
data: {
name: $('#us').val(),
pass: $('#pa').val()
},
success: function(data){
alert("success");
if(data=="true"){
location.href ="/";
}else{
var mm=$('#myModal');
mm.modal('show');
setTimeout(function(){mm.modal('hide');},2000);
return false;
}
},
error: function(){
alert("error");
}
});
});
});
</script>
火狐浏览器不实现 jquery-ajax 只弹出 begin 怎么解决?
大神们呢?求帮忙解决一下下。。。
google 和 火狐 的结果分别为
Processing by SessionsController#create as */*
Parameters: {"name"=>"", "pass"=>""}
Processing by SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"hAIonBhsfCh5rZDGKR6aT1i8oRbSm/DuBVfPJNH6QHU=", "session"=>{"username"=>"zhangsan", "password"=>"[FILTERED]"}, "commit"=>"登录"}
怎么让他们统一》?
1 发送过去了、、它只显示英文不显示中文 2 报错 bad uri 如 3 楼所示
#coding: UTF-8
class PhoneController < ApplicationController
#require 'net/http'
require 'iconv'
def pwd_phone
@phone_number=params[:phone_num]
@user=User.find_by_phone_number(@phone_number)
if @user.nil?
redirect_to :back
else
@pass=""
6.times do
@pass=@pass+rand(9).to_s
end
input_encode='gbk'
out_encode='utf8'
@str="您的身份校验码为:"+@pass+"(30分钟有效)。"
url="http://www.smsadmin.cn/smsmarketing/wwwroot/api/get_send/?uid=liker&pwd=0&mobile=155********&msg=ninhao"+@str
@rs=Iconv.new(out_encode,input_encode).iconv(Net::HTTP.get(url))
a=@rs.split(//).first
if a.to_i==0
else
redirect_to "/phone/result?rs="+a+"&rss="+@pass+"&str="+@str
end
end
end
end
昨天没试中文的 英文的已经能实现了、、
还是不行啊!急需解决、、求帮忙、
input_encode='gbk'
out_encode='utf8'
@str="您的身份校验码为:"+@pass+"(30分钟有效)。"
url='http://www.smsadmin.cn/smsmarketing/wwwroot/api/get_send/?uid=****&pwd=******&mobile=155********&msg=ninhao#{URI.escape(@str)}'
@rs=Iconv.new(out_encode,input_encode).iconv(Net::HTTP.get(URI(url)))
<% @str.split(//).each do |e|%>
<%= e.unpack('H*').to_s+"\n" %>
<% end %>