Advertisement
jet804

nextcloud apache2 config

Jul 16th, 2021
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. #192.168.0.231 is the Nextcloud server and port 9402 is used in the docker file.
  2. <VirtualHost *:80>
  3. ServerName nextcloud.domain.com
  4. Redirect permanent / https://nextcloud.domain.com/login
  5. ErrorLog ${APACHE_LOG_DIR}/nextcloud-error.log
  6. CustomLog ${APACHE_LOG_DIR}/nextcloud-access.log combined
  7. ProxyPreserveHost On
  8. ProxyPass / http://192.168.0.231:9402/
  9. ProxyPassReverse / http://192.168.0.231:9402/
  10. RewriteEngine On
  11. RewriteRule ^/\.well-known/carddav http://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  12. RewriteRule ^/\.well-known/caldav http://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  13. RewriteCond %{SERVER_NAME} =nextcloud.domain.com
  14. RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  15. </VirtualHost>
  16.  
  17. <VirtualHost *:443>
  18. ServerName nextcloud.domain.com
  19. Redirect permanent / https://nextcloud.domain.com/login
  20. ErrorLog ${APACHE_LOG_DIR}/nextcloud-error.log
  21. CustomLog ${APACHE_LOG_DIR}/nextcloud-access.log combined
  22. SSLEngine On
  23. ProxyPreserveHost On
  24. ProxyPass / http://192.168.0.231:9402/
  25. ProxyPassReverse / http://192.168.0.231:9402/
  26. # Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
  27. RewriteEngine On
  28. RewriteRule ^/\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  29. RewriteRule ^/\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  30. Include /etc/letsencrypt/options-ssl-apache.conf
  31. SSLCertificateFile /etc/letsencrypt/live/cloud.plexrva.com-0001/fullchain.pem
  32. SSLCertificateKeyFile /etc/letsencrypt/live/cloud.plexrva.com-0001/privkey.pem
  33. </VirtualHost>
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement