项目构建部署中遇到的问题: 1.不使用hash,如何解决刷新页面404的问题? 说明: root 指定项目地址路径,默认为nginx下的html index 默认访问index文件 try_files 这里其实是由if变过来的,意思是如果uri存在,那就访问uri资源,如果uri不存在,那就访问改目 ...
分类:
Web程序 时间:
2017-12-19 15:11:44
阅读次数:
333
location / { root 项目名称; index index.html index.php; try_files $uri $uri/ =404; if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; #重点 } ...
分类:
Web程序 时间:
2017-12-02 15:09:13
阅读次数:
213
server{
listen80;
server_namewww.idc.dev;
access_log/data/wwwlogs/www.idc.dev_nginx.logcombined;
indexindex.htmlindex.htmindex.php;
root/mnt/hgfs/woker_project/www.idc.dev/wwwroot;
location/{
try_files$uri@apache;
#跨域设置
add_headerAccess-Control-Allow-..
分类:
其他好文 时间:
2017-11-22 17:51:15
阅读次数:
221
博客原地址
#https访问
server{
listen443;
server_namewww.baidu.com;
root/var/www/html;
indexindex.phpindex.htmlindex.htm;
sslon;
location/{
try_files$uri$uri//index.php?$query_string;
#client_max_body_size50m;
}
ssl_certificatecert/214227810490073.pem;
s..
分类:
Web程序 时间:
2017-11-22 00:56:45
阅读次数:
166
博客原地址
#https访问
server{
listen443;
server_namewww.baidu.com;
root/var/www/html;
indexindex.phpindex.htmlindex.htm;
sslon;
location/{
try_files$uri$uri//index.php?$query_string;
#client_max_body_size50m;
}
ssl_certificatecert/214227810490073.pem;
s..
分类:
Web程序 时间:
2017-11-22 00:54:53
阅读次数:
202
HTTP和HTTPS的区别 所以在涉及到账户、金钱等敏感信息交互的时候使用HTTPS是个不错的选择。 申请证书 nginx配置 server { listen 443; #listen [::]:80; server_name passport.ddhigh.com; index index.htm ...
分类:
其他好文 时间:
2017-08-31 14:25:44
阅读次数:
207
#catapp.test.com.conf
server{
listen80;
server_nameapp.test.com;
indexindex.htmlindex.htmindex.php;
root/data0/web_root/app.test.com/www;
location/{
try_files$uri$uri//index.php$is_args$args;
}
includevhosts/rewrite_app.conf;
#error_page404/404.html;
err..
分类:
Web程序 时间:
2017-08-22 00:23:04
阅读次数:
152
server { listen 80; server_name www.xxx.cn; #静态页面 #匹配首页,url:www.xxx.cn index index.html; root /usr/local/nginx/html/admin/; #匹配... ...
分类:
其他好文 时间:
2017-08-11 21:14:33
阅读次数:
170
你需要开启HTML5 History 模式vue-router 默认 hash 模式 —— 使用 URL 的 hash 来模拟一个完整的 URL,于是当 URL 改变时,页面不会重新加载。如果不想要很丑的 hash,我们可以用路由的 history 模式,这种模式充分利用 history.pushS ...
分类:
其他好文 时间:
2017-06-30 11:10:35
阅读次数:
149
Nginx至少存在两种不同的配置来指定错误页面: 使用try_files配置项。 使用error_page配置项。 先介绍使用try_files配置项的情况。 Nginx提供的try_files配置允许在一个location中指定多个潜在的可能的响应页面,Nginx将按照定义的次序依次尝试访问这些响 ...
分类:
其他好文 时间:
2017-06-22 20:49:06
阅读次数:
252