Comments (10)
把 pwa 关了试试
Line 167 in 56395e3
from mikutools.
关了没有问题,但是还想启用 pwa,这样怎么修改呀?
from mikutools.
还是有这个问题,只是在首页那边的没有了,在刷新或打开一个子页面时会存在这个问题?
现在是 pwa 关闭状态
还有什么办法吗?
我看你的站点也有一次301的问题
另外有点奇怪,每次打开 /lifecount 这样的url时会先转到 /lifecount/ 再打开/lifecount ,这样就产生了301
from mikutools.
不影响使用吧
from mikutools.
是不影响使用,这个是什么原因引起的,能优化吗?
from mikutools.
参考:
https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-router#trailingslash
from mikutools.
非常感谢上面的方法能解决这个问题,谢谢。
但是还是想不带后面的/ 又不想有301,打包发布到线上后还是不行
我看nuxt官方文档上面 router.trailingSlash=false 时是不加/ 的
实际上设置false时还是加上了,这个有什么办法解决吗?
from mikutools.
我没弄过这个需求,所以暂时不知道具体的解决方案,也对这部分不是很了解
请求 /lifecount/
时,请求的具体内容是 /lifecount/index.html
,如果末尾不加 /
,访问的就是 lifecount
这个文件,我觉得应该是 http 服务器的特性
在新版本的 nginx(≥1.11.8) 中,可以通过设置 absolute_redirect off; 来解决
server {
listen 8080;
server_name www.mydomain.com;
absolute_redirect off; #取消绝对路径的重定向
root html;
...
}
我也没试过这个方案,你可以尝试一下
from mikutools.
我尝试了 absolute_redirect off;
router.trailingSlash=false 、 router.trailingSlash=true 、和不加这个配置
都还是不行,但在本地yarn dev 运行时 router.trailingSlash=false 是可以的
这个也很奇怪,感觉不是nginx这的问题,因为我输入 /lifecount/index.html时是打不开的,也就是走的应该是vue路由吧
from mikutools.
我刚在本地测试了一下
用例1:
yarn dev 运行起来后,用nginx反向代理到 http://localhost:3000 一切正常
用例2:
yarn generate 打包后,用nginx指向本地目录 dist ,不管nginx怎么配置都城要301
从结果上分析,是没有生成前是没有具体的目录的,生成后确实访问的是目录下面的文件,但nginx不管怎么配置都好像不启作用一样
from mikutools.
Related Issues (20)
- 怎么优化页面大小 HOT 1
- 验证邮件链接指向无效 HOT 1
- 页面加载速度慢 HOT 1
- 新增加一个页面,title没生效
- 页面加载两次 HOT 2
- 有没有开发格式转换功能的计划呢 HOT 1
- 有没有打算开发一个 json 格式化的呢 HOT 3
- 我想问一下 HOT 1
- 有没有一个搭建教程
- “帮你百度”功能无法处理空格等字符 HOT 2
- 又挂了? HOT 1
- 关于api问题
- 关于原神语音合成 HOT 1
- 身份证添加水印的功能在移动端下载图片的时候只有水印没有显示图片内容。 HOT 1
- `width: 100vw` issue on Windows HOT 1
- 服务器部署需要什么环境
- 抖音隐藏图
- [Feature Request] diff 工具
- 使用extract-text-webpack-plugin@next也无法解决
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mikutools.