-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用阿里云cdn证书报错:The change you wanted was rejected. #133
Comments
ApplicationController 里有一行代码,可以把注释去掉试试,记得重启 docker skip_before_action :verify_authenticity_token |
注释去掉之后,docker起不来了 == 20181205180629 AddFeaturesToPkg: migrated (0.0005s) ======================== == 20190123090654 AddArchiveToApps: migrating ================================= -- add_column(:apps, :archived, :boolean, {:default=>false}) -> 0.0004s == 20190123090654 AddArchiveToApps: migrated (0.0005s) ======================== == 20210119125335 AddExtInfoToPkgs: migrating ================================= -- add_column(:pkgs, :ext_info, :string) -> 0.0005s == 20210119125335 AddExtInfoToPkgs: migrated (0.0020s) ======================== == 20210121074133 RemoveSoftDelete: migrating ================================= == 20210121074133 RemoveSoftDelete: migrated (0.0200s) ======================== [....] Starting nginx: nginx[ ok . Puma starting in single mode...
/app/config/initializers/rack.rb:3: warning: already initialized constant Rack::Multipart::Parser::BUFSIZE /usr/local/bundle/gems/rack-2.2.3/lib/rack/multipart/parser.rb:12: warning: previous definition of BUFSIZE was here
Use Ctrl-C to stop [....] Starting nginx: nginx[ ok . Puma starting in single mode...
/app/config/initializers/rack.rb:3: warning: already initialized constant Rack::Multipart::Parser::BUFSIZE /usr/local/bundle/gems/rack-2.2.3/lib/rack/multipart/parser.rb:12: warning: previous definition of BUFSIZE was here ! Unable to load application: ArgumentError: Before process_action callback :verify_authenticity_token has not been defined Traceback (most recent call last):
/usr/local/bundle/gems/activesupport-5.2.4.4/lib/active_support/callbacks.rb:701:in |
哈哈哈,这么尴尬,那要不换个写法,在config/application.rb加入以下配置 config.action_controller.default_protect_from_forgery = false |
我放弃了,登录态用http,非登录态用https。 另外我还发现docker里目录权限问题,nginx用www-data用户启动的,然后上传的的文件所有者是root,导致下载文件的时候403无权限。所以上传的文件写磁盘的时候是puma进程完成的么,看到puma进程是root用户运行的。 |
但是,权限是给的 -rw-r--r-- ,所以 ng 下载文件不会出现这个问题才对的哦,我测试和其他人使用也并没遇到你说的这个问题,是不是哪里搞错了? |
可能是因为我把data目录映射到阿里云oss导致的,把nginx改成root用户运行就可以。另外想问下可以自定安装包的下载链接么,因为我把上传文件的目录映射到oss,相当于文件都上传到oss上了。如果可以自定义下载链接,就可以直接从oss下载了,虽然我给服务器套了cdn,但是只为了方便上证书,服务器的回源带宽还是很低的。如果能直接从oss下载,速度会快很多。 |
或许你要的答案这里有 |
docker镜像版本:tinyc/app-host:0.2.3
nginx配置:
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_pass http://127.0.0.1:8686;
}
nginx只开启了80端口,外面套了一层阿里云的cdn,证书通过阿里云的cdn申请和自动部署的
The text was updated successfully, but these errors were encountered: