#------------------------------------------------
# HTTP → HTTPS pro oznamzde.cz
<VirtualHost *:80>
    ServerAdmin webmaster@oznamzde.cz
    ServerName oznamzde.cz
    DocumentRoot /var/www/oznamzde/public

    <Directory /var/www/oznamzde/public>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/oznamzde_error.log
    CustomLog ${APACHE_LOG_DIR}/oznamzde_access.log combined

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin webmaster@oznamzde.cz
    ServerName oznamzde.cz
    DocumentRoot /var/www/oznamzde/public

    <Directory /var/www/oznamzde/public>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/oznamzde_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/oznamzde_ssl_access.log combined

    SSLEngine on
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite HIGH:!aNULL:!MD5

    SSLCertificateFile /etc/letsencrypt/live/oznamzde.cz/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/oznamzde.cz/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

#------------------------------------------------
# HTTP → HTTPS pro provoztodo.oznamzde.cz
<VirtualHost *:80>
    ServerAdmin webmaster@provoztodo.oznamzde.cz
    ServerName provoztodo.oznamzde.cz
    DocumentRoot /var/www/provoztodo/public

    <Directory /var/www/provoztodo/public>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/provoztodo_error.log
    CustomLog ${APACHE_LOG_DIR}/provoztodo_access.log combined

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin webmaster@provoztodo.oznamzde.cz
    ServerName provoztodo.oznamzde.cz
    DocumentRoot /var/www/provoztodo/public

    <Directory /var/www/provoztodo/public>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/provoztodo_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/provoztodo_ssl_access.log combined

    SSLEngine on
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite HIGH:!aNULL:!MD5

    SSLCertificateFile /etc/letsencrypt/live/provoztodo.oznamzde.cz/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/provoztodo.oznamzde.cz/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

#------------------------------------------------
# HTTP → HTTPS pro todoservices.shibia.cz
<VirtualHost *:80>
    ServerAdmin webmaster@todoservices.shibia.cz
    ServerName todoservices.shibia.cz
    DocumentRoot /var/www/demotodo/nettetodoservices/www

    <Directory /var/www/demotodo/nettetodoservices/www>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/todoservices_error.log
    CustomLog ${APACHE_LOG_DIR}/todoservices_access.log combined

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin webmaster@todoservices.shibia.cz
    ServerName todoservices.shibia.cz
    DocumentRoot /var/www/demotodo/nettetodoservices/www

    <Directory /var/www/demotodo/nettetodoservices/www>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/todoservices_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/todoservices_ssl_access.log combined

    SSLEngine on
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite HIGH:!aNULL:!MD5

    SSLCertificateFile /etc/letsencrypt/live/todoservices.shibia.cz/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/todoservices.shibia.cz/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>












#------------------------------------------------
# HTTP → HTTPS (betatodo.oznamzde.cz)
<VirtualHost *:80>
    ServerAdmin webmaster@betatodo.oznamzde.cz
    ServerName betatodo.oznamzde.cz
    DocumentRoot /var/www/demotodo/wapp/public

    <Directory /var/www/demotodo/wapp/public>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/betatodo_error.log
    CustomLog ${APACHE_LOG_DIR}/betatodo_access.log combined

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin webmaster@betatodo.oznamzde.cz
    ServerName betatodo.oznamzde.cz
    DocumentRoot /var/www/demotodo/wapp/public

    <Directory /var/www/demotodo/wapp/public>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/betatodo_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/betatodo_ssl_access.log combined

    SSLEngine on
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite HIGH:!aNULL:!MD5

    SSLCertificateFile /etc/letsencrypt/live/betatodo.oznamzde.cz/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/betatodo.oznamzde.cz/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

#------------------------------------------------
# HTTP → HTTPS (todo.oznamzde.cz)
<VirtualHost *:80>
    ServerAdmin webmaster@todo.oznamzde.cz
    ServerName todo.oznamzde.cz
    DocumentRoot /var/www/demotodo/dist

    <Directory /var/www/demotodo/dist>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/todo_error.log
    CustomLog ${APACHE_LOG_DIR}/todo_access.log combined

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

#------------------------------------------------
# HTTPS (SSL) + HSTS (todo.oznamzde.cz)
<VirtualHost *:443>
    ServerAdmin webmaster@todo.oznamzde.cz
    ServerName todo.oznamzde.cz
    DocumentRoot /var/www/demotodo/dist

    <Directory /var/www/demotodo/dist>
        AllowOverride All
        Options -Indexes +FollowSymLinks
        Require all granted

        # Pokud používáš Vue Router v "history" módu:
        <IfModule mod_rewrite.c>
            RewriteEngine On
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^ index.html [L]
        </IfModule>
    </Directory>

    Header set X-Robots-Tag "noindex, nofollow"

    ErrorLog ${APACHE_LOG_DIR}/todo_ssl_error.log
    CustomLog ${APACHE_LOG_DIR}/todo_ssl_access.log combined

    SSLEngine on
    SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
    SSLCipherSuite HIGH:!aNULL:!MD5

    SSLCertificateFile /etc/letsencrypt/live/todo.oznamzde.cz/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/todo.oznamzde.cz/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf

    # Přidání HSTS hlavičky
    <IfModule mod_headers.c>
        Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    </IfModule>
</VirtualHost>
