apache - 上传的头像图像未在 GitLab 中显示

标签 apache amazon-web-services ubuntu gitlab bitnami

在我的 gitlab 配置 /etc/gitlab/gitlab.rb ,我只有以下代码未注释。

external_url 'http://gitlab.mydomain.com:8888'
unicorn['worker_timeout'] = 6000
unicorn['port'] = 8888
web_server['external_users'] = ['www-data']
nginx['enable'] = false
ci_nginx['enable'] = false

再次通过运行重新配置,
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart

并在 /opt/bitnami/apache2/conf/bitnami/httpd.conf 上为 apache 配置了虚拟主机
<VirtualHost *:80>
ServerName gitlab.mydomain.com
DocumentRoot /opt/gitlab/

ProxyPass / http://127.0.0.1:8888/
ProxyPassReverse / http://127.0.0.1:8888/

# Custom log file locations
ErrorLog /opt/bitnami/apache2/logs/gitlab_error.log
CustomLog /opt/bitnami/apache2/logs/gitlab_access.log combined
</VirtualHost>

当我更新个人资料头像时,文件正在上传到 /opt/gitlab/embedded/service/gitlab-rails/public/uploads/user/avatar/2/avatar.png
但是图像没有显示在 Web 界面中,并且附加到界面的图像位置是 http://gitlab.mydomain.com:8888/uploads/user/avatar/2/avatar.png
我可以直接访问 http://gitlab.mydomain.com/uploads/user/avatar/2/avatar.png 上的头像.

我怎样才能 mode_rewrite 端口 8888 上的所有请求没有端口号?或任何其他解决方案来解决这个问题?

最佳答案

如“Gitlab and Apache - Uploaded images 404 errors ”中所述,您无需在 external_url 中指定端口。 .

在你的情况下,那将是:

external_url 'http://gitlab.mydomain.com'

然后显示的 url 将始终为 http://gitlab.mydomain.com ,而不是 http://gitlab.mydomain.com:8888 .

关于apache - 上传的头像图像未在 GitLab 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40435755/

相关文章:

apache - 如何使这项工作? RewriteCond %{ENV :UNIQUE_ID} ! %{QUERY_STRING}

node.js - Node 能够发出http请求 Node js aws lambda

python - 安装 pygame ubuntu 时遇到问题

iphone - 转换 iPhone 视频 - ffmpeg

apache - 公钥固定不起作用

php - 如何将 SQLSRV 扩展安装到 php XAMPP

php - 使 PHP 能够读取 .css 和 .js 文件,同时保持其原始内容类型

node.js - 远程调试托管在 AWS 上的 Node 应用程序

amazon-web-services - 如何在 Amazon Elastic Beanstalk 实例中安装 Oracle Java 7

linux - Chef chef-validator.pem 安全