Hello,
I'm using docker to run and develop my laravael applications in a php-container, besides a nginx- and a mysql-container.
Andrew Schmelyun explained a similar setup in this video: https://www.youtube.com/watch?v=mZbLvGQqEvY
That works like a charm and local development is also working as long as I used webpack.
But now I'm struggling in using vite.
Does anyone has an idea how I can use vite behind traefik in a local environment?
To use Vite behind Traefik in a local environment, you need to configure Traefik to forward requests to the Vite server. Here's an example configuration for Traefik:
This configuration sets up a router that forwards requests to the Vite server running on port 3000. You can customize the router rule to match your local domain name.
Make sure to update your hosts file to point the domain name to your local IP address:
127.0.0.1 vite.local
With this configuration, you should be able to access your Vite server at http://vite.local and Traefik will handle the routing.