Skip to content

Instantly share code, notes, and snippets.

@keyakko
Last active August 5, 2020 19:01
Show Gist options
  • Save keyakko/7622404a3a625b1dede3d05c718b6fa4 to your computer and use it in GitHub Desktop.
Save keyakko/7622404a3a625b1dede3d05c718b6fa4 to your computer and use it in GitHub Desktop.
Running Nuxt.js SSR in cheap web server...
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_URI} ^((?!/static/)).*$
RewriteCond %{REQUEST_URI} ^((?!/index.fcgi)).*$
RewriteRule ^(.*)$ /index.fcgi/$1 [QSA,L]
const fcgi = require('node-fastcgi')
const { loadNuxt, build } = require('nuxt')
async function listen() {
const nuxt = await loadNuxt('start')
fcgi.createServer(nuxt.render).listen()
}
listen()
#!/PATH/TO/node app.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment