首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在URL /path/下运行CKAN的CKAN和NGINX conf

在URL /path/下运行CKAN的CKAN和NGINX conf
EN

Stack Overflow用户
提问于 2020-08-30 19:24:12
回答 1查看 605关注 0票数 0

通过遵循关于如何从源安装的说明部署,我在本地Debian中设置了CKAN2.9。

我使用NGINX、UWSGI和Supervisor运行CKAN,但是,当我试图更改运行CKAN的URL路径时,我遇到了麻烦。

请参阅在http://192.168.60.11/中运行良好的CKAN,但我希望它在 http://192.168.60.11/ckan中运行

为此,我更改了In ckan.ini ckan.site_url to ckan.site_url = http://192.168.60.11/ckan`

NGINX默认站点conf为:

代码语言:javascript
复制
    location /ckan/ {
        proxy_pass http://127.0.0.1:8080/;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_cache cache;
        proxy_cache_bypass $cookie_auth_tkt;
        proxy_no_cache $cookie_auth_tkt;
        proxy_cache_valid 30m;
        proxy_cache_key $host$scheme$proxy_host$request_uri;
        # In emergency comment out line to force caching
        # proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
    }

重新加载nginx.service并重新启动supervisior.service

http://192.168.60.11/ckan/把我带到了CKNA登陆页面,但不是CSS/JS/图片加载。在浏览器中加载错误,如:Loading failed for the <script> with source “http://192.168.60.11/webassets/vendor/d8ae4bed_jquery.js”.

如果我单击指向数据集的链接,就会被定向到http://192.168.60.11/dataset/,而不是http://192.168.60.11/ckan/dataset/

以及在/etc/ckan/default/uwsgi.ERR中:

2020-08-30 19:19:41,554 INFO [ckan.config.middleware.flask_app] / render time 0.114 seconds [pid: 7699|app: 0|req: 53/53] 127.0.0.1 () {42 vars in 767 bytes} [Sun Aug 30 19:19:41 2020] GET / => generated 13765 bytes in 122 msecs (HTTP/1.0 200) 3 headers in 106 bytes (1 switches on core 0)

因此,似乎CKAN缺少一些配置参数,以使它知道URL路径。有什么办法吗?谢谢

EN

回答 1

Stack Overflow用户

发布于 2020-09-01 08:33:40

代码语言:javascript
复制
# ckan.ini
ckan.site_url = "http://public.domain" # no path suffix here
ckan.root_path = "/prefix"
代码语言:javascript
复制
# nginx config
location /prefix/ {
  proxy_pass http://127.0.0.1:8080; # no path suffix here
}

答案在CKAN文档

而nginx的位置只需从/更改为/custom/path

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63661310

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档