- 确认 Alfresco 和 NGINX 正确部署并运行,同时在 NGINX 上开启 HTTP 和 HTTPS 服务;
- 修改 Alfresco 全局配置文件 alfresco-global.properties,增加以下配置参数,以允许 Alfresco 功能正常使用 HTTPS:
alfresco.context=alfresco
alfresco.host=https://yourdomain.com
alfresco.protocol=https
alfresco.port=443
alfresco.proxyName=yourdomain.com
alfresco.proxyPort=443
alfresco.scheme=https
- 配置 NGINX 重定向,将 Alfresco 的 HTTP 请求重定向为 HTTPS。添加以下配置到 nginx.conf 文件中:
server {
listen 80;
server_name yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /path/to/your/cert.pem;
ssl_certificate_key /path/to/your/privkey.pem;
ssl_dhparam /path/to/your/dhparams.pem;
location / {
proxy_pass http://localhost:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto "https";
}
}
- 重启 NGINX 和 Alfresco,确认是否重定向到 HTTPS。