How do i host static vinxi build with nginx so the routing works, is there any guide?
Official docs are pretty much WIP.
4 Replies
Well, like any other nodejs app.
By default vinxi will build nitros standard nodejs app.
So running „npm run start“ you are starting the server.
In the nginx config you just map the port to the domain.
So something like this should be in your nginx config
‘‘‘
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
} ‘‘‘
} ‘‘‘
Static vinxi gives html js css output, why do I need node js server for?
i think they missed the
static
part. if it's just about serving static files, it's just like any other other nginx setup:
but the nested and dynamic
[routes]
doesnt work
returns 404
This worked