worker_processes 1;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
#html文件
server {
listen 1000;
server_name 127.0.0.1 localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/work/web/dist;#文件路径
index index.html;#默认打开的文件
#此为关键 , vue router mode此时可设置为`history`
#参考https://router.vuejs.org/zh-cn/essentials/history-mode.html
try_files $uri $uri/ /index.html;#匹配所有路径
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
nginx 简单配置vue 后台server
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 在项目开发中,前后台分离,做了假数据,项目使用vue2.0重构,后台也推到重来了,为了不耽误开发进程,我做了虚拟的...
- 1.下载vue-cli vue-cli的使用与详细介绍,可以到github上获取https://github.co...
- server.xml作为 tomcat 启动时的配置依据,其功能包含了配置访问端口,访问路径等,这里主要针对在同一...
- 我是日记星球121号星宝宝惠莲,正在参加孙老师的日记星球21天蜕变之旅的写作训练,这是我的第11篇原创日记。快快加...