Last active
August 5, 2020 19:01
-
-
Save keyakko/7622404a3a625b1dede3d05c718b6fa4 to your computer and use it in GitHub Desktop.
Running Nuxt.js SSR in cheap web server...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddHandler fcgid-script .fcgi | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^((?!/static/)).*$ | |
RewriteCond %{REQUEST_URI} ^((?!/index.fcgi)).*$ | |
RewriteRule ^(.*)$ /index.fcgi/$1 [QSA,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fcgi = require('node-fastcgi') | |
const { loadNuxt, build } = require('nuxt') | |
async function listen() { | |
const nuxt = await loadNuxt('start') | |
fcgi.createServer(nuxt.render).listen() | |
} | |
listen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/PATH/TO/node app.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment