Guest User

apache2 help

a guest
Jan 18th, 2022
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <VirtualHost *:80>
  2. ServerName xxxx.xxxx.com
  3. Redirect / https://xxxx.xxxx.com/login
  4. ErrorLog ${APACHE_LOG_DIR}/nextcloud-error.log
  5. CustomLog ${APACHE_LOG_DIR}/nextcloud-access.log combined
  6. ProxyPreserveHost On
  7. ProxyPass / http://x.x.x.x:8080/
  8. ProxyPassReverse / http://x.x.x.x:8080/
  9. RewriteCond %{HTTPS} !=on
  10. RewriteCond %{HTTP:X-Forwarded-Proto} =http
  11. RewriteCond %{HTTP_HOST} ^xxxx.xxxx.com
  12. RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
  13. RewriteEngine On
  14. RewriteRule ^/\.well-known/carddav http://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  15. RewriteRule ^/\.well-known/caldav http://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  16. RewriteCond %{SERVER_NAME} =xxxx.xxxx.com
  17. RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  18. </VirtualHost>
  19.  
  20. <VirtualHost *:443>
  21. Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
  22. ServerName xxxx.xxxx.com
  23. ErrorLog ${APACHE_LOG_DIR}/nextcloud-error.log
  24. CustomLog ${APACHE_LOG_DIR}/nextcloud-access.log combined
  25. SSLEngine On
  26. ProxyPreserveHost On
  27. ProxyPass / http://x.x.x.x:8080/
  28. ProxyPassReverse / http://x.x.x.x:8080/
  29. RewriteEngine On
  30. RewriteRule ^/\.well-known/carddav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  31. RewriteRule ^/\.well-known/caldav https://%{SERVER_NAME}/remote.php/dav/ [R=301,L]
  32. Include /etc/letsencrypt/options-ssl-apache.conf
  33. SSLCertificateFile /etc/letsencrypt/live/xxxx.xxxx.com-0001/fullchain.pem
  34. SSLCertificateKeyFile /etc/letsencrypt/live/xxxx.xxxx.com-0001/privkey.pem
  35. </VirtualHost>
  36.  
Advertisement
Add Comment
Please, Sign In to add comment