웹 UI를 통해 업그레이드를 수행할 때 occasionally discourse가 다음 명령을 실행하라고 알려줍니다:
cd /var/discourse
git pull
./launcher rebuild app
rebuild 프로세스는 github에 여러 번 연결을 시도하는데, 제 서버가 호스팅된 중국에서는 github가 절반쯤 차단되어 있어 github에 더 잘 접근하기 위해 http/https 프록시를 설정해야 합니다. 프록시 없이 youtube에 접속했을 때와 프록시를 통해 접속했을 때의 비교는 다음과 같습니다:
expose 섹션에서 설정하신 30080:80에 따라, Nginx/Apache 등에서 프록시 요청만 설정하시면 됩니다.
예를 들어, 제 Nginx 설정은 다음과 같습니다 (30080 대신 2080을 사용):
/etc/nginx/sites-available/00-default-ssl.conf
server {
...
location / {
# THIS IS USED WITH NGINX WHEN DOCKER IS RUN NORMALLY (BRIDGED MODE)
proxy_pass http://example.com:2080/;
# THESE 2 LINES ARE USED IN CASE DOCKER NETWORK IS IN HOST MODE (--net=host)
#proxy_pass http://example.com:3000/;
#proxy_redirect http://example.com:2080/ https://example.com;
proxy_read_timeout 90;
proxy_http_version 1.1;
proxy_set_header Host $http_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-Host $host;
proxy_set_header X-Forwarded-Server $host;
error_page 502 =502 /errorpages/discourse_offline.html;
proxy_intercept_errors on;
# YOU MAY EXCLUDE REQUESTS FROM CERTAIN IP FROM ACCESS LOG
if ( $remote_addr = "x.x.x.x" )
{
access_log off;
}
}
location /errorpages/ {
alias /var/www/errorpages/;
}
}
컨테이너를 호스트 모드(--net=host)로 실행할 경우, 리다이렉트(위 예시와 같이 https일 가능성이 높음)를 사용하여 3000 포트를 사용하도록 프록시 설정을 전환하는 것을 고려해야 합니다.