Trong mỗi commit có các phần bình luận phía dưới có thể hướng dẫn 1 chút công việc đã làm ở commit đó
in folder nuxt-client/
npm run build
npm start
on server should install pm2 to run server node forever
npm install -g pm2
pm2 start npm --start
#Apache2
<VirtualHost *:80>
ServerName client.laravelserver.local
DocumentRoot "D:/xampp/htdocs/laravel-shopify-nuxtjs/laravel-shopify-nuxtjs-structure/nuxt-client/.nuxt/dist"
Options -Indexes
ProxyRequests on
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>
go url http://client.laravelserver.local to test app
setting file server.key
and server.crt
in nuxt-client
in file nuxt.config.js
import path from 'path'
import fs from 'fs'
in module.export
server: {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'server.key')),
cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'))
}
}
Now Nuxt run https ssl
<VirtualHost *:443>
ServerName client.laravelserver.local
ServerAlias www.mydomain.com
DocumentRoot "D:/xampp/htdocs/nuxt-laravel-shopify-jwt/nuxt-client/.nuxt/dist"
Options -Indexes
SSLEngine on
SSLProxyEngine On
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
ProxyRequests on
ProxyPreserveHost On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
ProxyPass / https://localhost:3000/
ProxyPassReverse / https://localhost:3000/
</VirtualHost>