我一直在尝试将我的Nextcloud更改为反向代理。以前没有反向代理也能正常工作。但是我想将它移到这个反向代理后面(使用通配符证书)。所以今天我重新安装了一次,但是还是没有成功。也许有人能帮助我。
Ubuntu:20.01 LTS Nexcloud安装与快照(Nextcloud 20)
已执行的命令:
$ sudo snap install nextcloud
$ sudo nextcloud.manual-install admin ###password###
$ sudo snap set nextcloud ports.http=81
$ sudo nextcloud.occ config:system:set trusted_domains 0 --value=https://cloud.mydomain.com
$ sudo snap connect nextcloud:removable-media
$ sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php
- 〉我将数据目录更改为我使用的目录
$ sudo nano /etc/apache 2/sites-available/000-default.conf -〉这里我粘贴了你的代码片段。这里我显示了我完整的000-default.conf(因为我认为问题可能在这里)。Ps:我还运行了一个jellyfin服务@ jellyfin.mydomain.nl(这是工作的)。在我的主机服务器上,我做了两个CNAME条目:1=cloud@mydomain.nl2=jellyfin@mydomain.nl
============
<VirtualHost *:80>
ServerName mydomain.nl
ServerAdmin webmaster@mydomain.nl
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<VirtualHost *:80>
ServerName jellyfin.mydomain.nl
# Uncomment for HTTP to HTTPS redirect
# Redirect permanent / https://DOMAIN_NAME
ErrorLog /var/log/apache2/DOMAIN_NAME-error.log
CustomLog /var/log/apache2/DOMAIN_NAME-access.log combined
If you are not using a SSL certificate, replace the ‘redirect’
line above with all lines below starting with ‘Proxy’
ServerName jellyfin.mydomain.nl # This folder exists just for certbot(You may have to create it, chown and chm> DocumentRoot /var/www/html/jellyfin/public_html
ProxyPreserveHost On
# Letsencrypt's certbot will place a file in this folder when updating/verifyi>
# This line will tell apache to not to use the proxy for this folder.
ProxyPass /.well_known/ !
ProxyPass "/socket" "ws://127.0.0.1:8096/socket"
ProxyPassReverse "/socket" "ws://127.0.0.1:8096/socket"
ProxyPass "/" "http://127.0.0.1:8096/"
ProxyPassReverse "/" "http://127.0.0.1:8096/"
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mydomain.nl/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.nl/privkey.pem
Protocols h2 http/1.1
# Enable only strong encryption ciphers and prefer versions with Forward Secre>
SSLCipherSuite HIGH:RC4-SHA:AES128-SHA:!aNULL:!MD5
SSLHonorCipherOrder on
Disable insecure SSL and TLS versions
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
ErrorLog /var/log/apache2/jellyfin.mydomain.nl-error.log
CustomLog /var/log/apache2/jellyfin.mydomain.nl-access.log combined
nextcloud
<VirtualHost *:80>
ServerName cloud.mydomain.nl
ServerAdmin webmaster@mydomain.nl
ProxyPreserveHost On
ProxyRequests Off
RewriteEngine On
RewriteRule ^/.well-known/carddav http://%{SERVER_NAME}/remote.php/dav/ [>
RewriteRule ^/.well-known/caldav http://%{SERVER_NAME}/remote.php/dav/ [R>
RewriteRule ^/.well-known/host-meta http://%{SERVER_NAME}/public.php?serv>
RewriteRule ^/.well-known/host-meta.json http://%{SERVER_NAME}/public.ph>
RewriteRule ^/.well-known/webfinger http://%{SERVER_NAME}/public.php?serv>
ProxyPass / http://localhost:81/
ProxyPassReverse / http://localhost:81/
vim: syntax=apache ts=4 sw=4 sts=4 sr noet
======================
如果我输入https://cloud.mydomain.nl,它会将我重定向到标准的apache,它的工作网站运行在80端口。
我真的很希望你能帮助我,因为这让我发疯!非常感谢!
1条答案
按热度按时间syqv5f0l1#
我知道这是一个老职位,但我发现它,而寻找其他东西,所以这里去...
我认为这是因为您没有一个conf文件在443上应答。您需要一个conf文件封装在以下内容中: