Closed kuatro closed 7 years ago
Hi! Cool. I'm just working on an improvement and once thats done I'll get back to you with the Nginx issue.
1/ I'm using pm2 manager to run node app with bin/start.js as starting point (maybe server-polyfl.js can be used but my file suits me better)
start.js: require('babel-register') module.exports = require('./server')
2/ created config for nginx/sites-available: upstream app_myaudit_xyz { server 127.0.0.1:3000; keepalive 80; } server {
#listen [::]:80;
#server_name ~^(www.)?myaudit.xyz$;
server_name myaudit.xyz www.myaudit.xyz;
root /home/app/www/dist/public;
location / {
try_files $uri @proxy;
}
location @proxy {
proxy_pass http://app_myaudit_xyz;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
I believe this info can lead you to a working solution
@pasechnik nice answer 👍
Hey! Everything works. Now I looking for some way to serve the app through Nginx. Which is the best way to start and daemonize babel-node process in production?