File: //etc/apache2/sites-enabled/015-textpony-prod.2amigos.us-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName textpony-prod.2amigos.us
ServerAlias textpony.com
DocumentRoot /var/www/vhosts/textpony-prod.2amigos.us/docroot/
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/coming-soon [NC]
RewriteCond %{REQUEST_URI} !^/images/.*$ [NC]
RewriteCond %{REQUEST_URI} !^/_next/.*$ [NC]
RewriteRule (.*)$ https://textpony.com/coming-soon [R=302,L]
<Directory /var/www/vhosts/textpony-prod.2amigos.us/docroot>
Options FollowSymLinks
AllowOverride All
</Directory>
#websocket
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://localhost:34200/$1 [P]
ProxyPass / http://127.0.0.1:34200/
ProxyPassReverse / http://127.0.0.1:34200/
ProxyRequests Off
RedirectMatch 404 /\.git
ErrorLog ${APACHE_LOG_DIR}/textpony-prod.2amigos.us-error_log
CustomLog ${APACHE_LOG_DIR}/textpony-prod.2amigos.us-access_log common
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/textpony.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/textpony.com/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName api.textpony.com
DocumentRoot /var/www/vhosts/textpony-prod.2amigos.us/docroot/
<Directory /var/www/vhosts/textpony-prod.2amigos.us/docroot>
Options FollowSymLinks
AllowOverride All
</Directory>
ProxyPass / http://127.0.0.1:34201/
ProxyPassReverse / http://127.0.0.1:34201/
ProxyRequests Off
RedirectMatch 404 /\.git
ErrorLog ${APACHE_LOG_DIR}/api.textpony-prod.2amigos.us-error_log
CustomLog ${APACHE_LOG_DIR}/api.textpony-prod.2amigos.us-access_log common
SSLCertificateFile /etc/letsencrypt/live/textpony.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/textpony.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>