/ Apache

Virtualhost de Apache con SSL y ProxyPass

Configuración básica de un virtualhost de apache con redirección a https y proxypass.

Esto no es la biblia, son apuntes que a mi me sirven, y tal vez también a ti.

<VirtualHost *:80>
    ServerName misitio.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/

    ErrorLog /var/www/logs/error.log
    CustomLog /var/www/logs/access.log combined

    RewriteEngine on
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI}[END,QSA,R=permanent]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName misitio.com
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/

<Directory /var/www/html/>
    Options Indexes FollowSymLinks
	AllowOverride None
	Order allow,deny
	Allow from all
</Directory>

<Proxy /resetpass>
    Order allow,deny
    Allow from all
</Proxy>
<Proxy /register_web>
    Order allow,deny
    Allow from all
</Proxy>

ProxyPass /subsitio https://misitio.com:5281/subsitio
ProxyPassReverse /subsitio https://misitio.com:5281/subsitio

ProxyPreserveHost On
SSLProxyEngine on
SSLEngine on
SSLOptions +StrictRequire

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

ErrorLog /var/www/logs/error.log
CustomLog /var/www/logs/access.log combined