Hi,
I’m using Sage 10 (6.15.2) in WSL2 with Ubuntu 22.04.2 LTS in Windows 10 Pro 22H2.
I cannot seem to make the dev server work properly from another device connected to my LAN. It works perfectly from Windows (at https://localhost:3000/). I tried port forwarding methods or using expose-wsl with my firewall disabled but all I can reach is the unstyled content of my home page.
From my phone, with either of these setups, if I access https://192.168.1.17:3000, the page doesn’t load the images nor the stylesheets, and if I click on any link it tries to load the url https://localhost:3000/page rather than https://192.168.1.17:3000/page. I assume it has to do with my bud or apache config but I can’t seem to solve the issue.
Here are the paths in my bud.config.js
/**
* Set public path
*/
app.setPublicPath('/wp-content/themes/mydomain/public/');
/**
* Development server settings
*/
app
.setUrl({
url: new URL('https://localhost:3000'),
cert: '/etc/ssl/certs/apache-selfsigned.crt',
key: '/etc/ssl/private/apache-selfsigned.key',
}
)
.setProxyUrl('https://dev.mydomain.fr/')
.watch(['resources/views', 'app']);
And mydomain.fr.conf
<VirtualHost *:443>
ServerAdmin webadmin@mydomain.fr
ServerName dev.mydomain.fr
ServerAlias www.dev.mydomain.fr
DirectoryIndex index.html index.php
DocumentRoot /home/name/public_html/mydomain.fr/public
<Directory /home/name/public_html/mydomain.fr/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
LogLevel warn
ErrorLog /var/log/apache2/error-mydomain.fr.log
CustomLog /var/log/apache2/access-mydomain.fr.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName dev.mydomain.fr
Redirect / https://dev.mydomain.fr/
</VirtualHost>
I have read pretty much anything I could find about this issue, and I’m no running out of ideas, anyone has an idea of how I could make it work ?
Thanks