我目前正在 Server Pilot 上部署我的 NuxtJS SSR 应用程序。我可以在服务器上执行 npm run build 和 run start ,它将开始侦听http://localhost:3000。如何将我的 www.example.com 重定向到 localhost:3000。使用 htaccess。
这个答案似乎有点晚了,但我只在 github 中找到它,并希望帮助任何发现此主题的人遇到相同的问题。
这个 htaccess 对我有用,当我刷新并且导航正常时,它会正常加载 index.vue 页面。
将 my-domain 替换为您的域。
RewriteEngine on
# Forcing all incoming requests to HTTPS.
# HTTPS is required for PWA. If you don't want PWA feature you can deisable next 2 lines
RewriteCond %{HTTP_HOST} ^my-domain.com.br$
RewriteRule "(.*.(jpg|gif|png|svg|js|css|woff2))$" "http://127.0.0.1:3000/$1" [P,NC]
RewriteRule ^(.*) "http://127.0.0.1:3000/$2" [P,L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句