I have a Mac Mini that I have installed XAMPP (Apache+MySQL). And I have configured with cloudflared tunnel and works with a single domain website.
However, I have trouble to serve multiple different domains with CloudFlared Tunnel.
Have anyone tried to configure multiple domains on a single PC using CloudFlared Tunnel ? If so, can you explain how it is done ? Thanks.
UPDATE 1:
Goal is a single tunnel for multiple domains, each domain serves a different site. Sample configuration file (single tunnel) ~/.cloudflared/config.yml:
tunnel: TUNNEL_ID credentials-file: /path/to/credentials_file/TUNNEL_ID.json
ingress:
- hostname: domain1.com
service: https://www.site1.local:443
originRequest:
noTLSVerify: true
- hostname: domain2.com
service: https://www.site2.local:443
originRequest:
noTLSVerify: true
- service: http_status:404
The above config file works for the first domain which serves site1.local. However, the second domain always serve site1.local instead of site2.local.
UPDATE 2:
Unable to assign specific port (in this example it is 7443) for the domain. returns this error ERR_SSL_PROTOCOL_ERROR. FYI, I am using MacMini M1, XAMP (with Apache).
httpd-ssl.conf file:
---------------------
Listen 7443
<VirtualHost _default_:7443>
ServerName www.site1.local
ServerAlias *.site1.local
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1"
<Directory "/applications/XAMPP/xamppfiles/htdocs/site1">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile "/Applications/XAMPP/xamppfiles/etc/ssl.crt/server.crt"
SSLCertificateKeyFile "/Applications/XAMPP/xamppfiles/etc/ssl.key/server.key"
ErrorLog "/Applications/XAMPP/xamppfiles/logs/mysite-ssl-error_log"
</VirtualHost>
---------------------
config.yml file:
---------------------
tunnel: TUNNEL_ID
credentials-file: /path/to/credentials_file/TUNNEL_ID.json
ingress:
- hostname: domain1.com
service: https://www.site1.local:7443
originRequest:
noTLSVerify: true
- service: http_status:404
---------------------