Docker上的Nginx反向代理和卸载的资产

我想让我的博客(由Ghost支持)通过Docker提供服务,并可以通过URL cv.totem.io/blog访问。

问题是,URL不能纠正。 对于亲属url: <script src="/ghost/ghost.js?v=b0685c4e1f"></script>而对于绝对: <link rel="canonical" href="http://localhost:2368/">

这似乎是绝对URL的Docker容器的configuration问题,以及来自Nginx亲属的一个问题。

这是我的Nginxconfiguration:

 server { listen 443; server_name cv.totem.io; rewrite ^(.*) http://$host$1 permanent; } upstream blog { server 127.0.0.1:7070; keepalive 8; } server { server_name www.cv.totem.io cv.totem.io; location / { root /var/www/totem/curriculum; index index.html index.htm; } location /blog { proxy_pass http://blog/; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_redirect off; } } 

docker容器已经通过这个命令新鲜安装:

docker run --name some-ghost -p 7070:2368 -d ghost

你必须在URL中包含/博客来匹配nginx中的“位置/博客”块。

更改url如下:

 <script src="/blog/ghost/ghost.js?v=b0685c4e1f"> <link rel="canonical" href="http://localhost:2368/blog">