WordPress——Argon主题美化

文章目录

  • Argon主题美化
    • 插件类
      • 类别标签页面
      • 更新管理器
      • 文章头图URL
      • 查询监视器
      • WordPress提供Markdown语法
      • 评论区头像设置
      • 发信设置
      • 隐藏登陆
      • 备份设置
      • 缓存插件
    • 主题文件编辑器
      • 页脚显示在线人数
      • 备案信息(包含备案信息+网站运行时间)
      • banner下方小箭头滚动效果
      • 站点功能概览下方Links功能
    • 额外CSS
    • 页头脚本
    • 页尾脚本
  • 错误解决
      • 413 request Entity too Large
      • 设置http响应头Cache-Control及Pragma,增加CDN cache命中率
      • wordpress更改固定链接模式后前台文件打开404

Argon主题美化

插件类

类别标签页面

Category Tag Pages插件

为您的页面添加类别和标签功能

更新管理器

Easy Updates Manager插件 可以关闭wordpress翻译更新

文章头图URL

Featured Image from URL (FIFU)插件

查询监视器

Query Monitor插件

  1. 页面生成时间(以秒为单位)
  2. 峰值内存使用量
  3. SQL 查询所用的总时间(以秒为单位)
  4. SQL 查询总数

WordPress提供Markdown语法

WP Githuber MD插件

评论区头像设置

WP-China-Yes 插件

发信设置

除了发信,还可以屏蔽一些WordPress不常用的功能

WPJAM BASIC 插件

隐藏登陆

可以自定义设置登陆地址

WPS Hide Login插件

备份设置

WPvivid 备份插件

缓存插件

WP super cache插件

主题文件编辑器

页脚显示在线人数

# 网站显示 外观 >> 主题文件编辑器 >> footer.php(主题页脚)也可以添加到Argon主题选项的页脚栏中
# 在第四行以后插入
<?php
$online_log = "/usr/local/nginx/html/wordpress/wp-content/themes/argon-theme-master/maplers.dat"; // 保存人数的文件路径(根据实际情况设置)
$timeout = 30; // 30秒内没动作者,认为掉线

// 检查文件是否存在,如果不存在则创建它
if (!file_exists($online_log)) {
    $fp = fopen($online_log, "w");
    fclose($fp);
    chmod($online_log, 0666); // 设置文件权限为可读可写
}

$entries = file($online_log);
$temp = array();

for ($i = 0; $i < count($entries); $i++) {
    $entry = explode(",", trim($entries[$i]));
    if (($entry[0] != $_SERVER['REMOTE_ADDR']) && ($entry[1] > time())) {
        array_push($temp, $entry[0] . "," . $entry[1] . "\n");
    }
}
array_push($temp, $_SERVER['REMOTE_ADDR'] . "," . (time() + ($timeout)) . "\n");
$maplers = count($temp);

$entries = implode("", $temp);

// 写入文件
$fp = fopen($online_log, "w");
flock($fp, LOCK_EX);
fputs($fp, $entries);
flock($fp, LOCK_UN);
fclose($fp);

echo "当前在线人数:".$maplers."人";
?>

备案信息(包含备案信息+网站运行时间)

# 网站显示 外观 >> 主题文件编辑器 >> footer.php(主题页脚) 也可以添加到Argon主题选项的页脚栏中
# 在第四行以后插入
<style>
/* 核心样式 */
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 13.1px;
color: #fff;
line-height: 15px;
margin-bottom: 5px;
font-family: "Open Sans", sans-serif;
}
.github-badge .badge-subject {
display: inline-block;
background-color: #4d4d4d;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
font-family: "Open Sans", sans-serif;
}
.github-badge .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
font-family: "Open Sans", sans-serif;
}
.github-badge-big {
display: inline-block;
border-radius: 6px;
text-shadow: none;
font-size: 14.1px;
color: #fff;
line-height: 18px;
margin-bottom: 7px;
}
.github-badge-big .badge-subject {
display: inline-block;
background-color: #4d4d4d;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
.github-badge-big .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
.bg-orange {
background-color: #ec8a64 !important;
}
.bg-red {
background-color: #cb7574 !important;
}
.bg-apricots {
background-color: #f7c280 !important;
}
.bg-casein {
background-color: #dfe291 !important;
}
.bg-shallots {
background-color: #97c3c6 !important;
}
.bg-ogling {
background-color: #95c7e0 !important;
}
.bg-haze {
background-color: #9aaec7 !important;
}
.bg-mountain-terrier {
background-color: #99a5cd !important;
}
</style>

<div class="github-badge-big">
    <span class="badge-subject"><i class="fa fa-id-card"></i> 备案号 </span>
    <span class="badge-value bg-orange">
        <!-- 备案链接 -->
        <a href="https://beian.miit.gov.cn/" target="_blank" one-link-mark="yes">晋ICP备1111号</a> |
        <a href="https://www.beian.gov.cn/portal/index?token=e547b70c-fbe1-4c80-a4a2-857b17389a71" target="_blank" one-link-mark="yes">
            <img src="图片" alt="晋公网安备11111号">
            晋公网安备14050002001833号
        </a>
    </span>
</div>
	<!-- 运行时间 -->
    <div class="github-badge-big">
        <span class="badge-subject"><i class="fa fa-clock-o"></i> Running Time</span><span
            class="badge-value bg-apricots"><span id="blog_running_days" class="odometer odometer-auto-theme"></span>
            days
            <span id="blog_running_hours" class="odometer odometer-auto-theme"></span> H
            <span id="blog_running_mins" class="odometer odometer-auto-theme"></span> M
            <span id="blog_running_secs" class="odometer odometer-auto-theme"></span>S
        </span>
 <script no-pjax="">
var blog_running_days = document.getElementById("blog_running_days");
var blog_running_hours = document.getElementById("blog_running_hours");
var blog_running_mins = document.getElementById("blog_running_mins");
var blog_running_secs = document.getElementById("blog_running_secs");
function refresh_blog_running_time() {
var time = new Date() - new Date(2024, 4, 8, 0, 0, 0); /*此处日期的月份改为自己真正月份的前一个月*/
var d = parseInt(time / 24 / 60 / 60 / 1000);
var h = parseInt((time % (24 * 60 * 60 * 1000)) / 60 / 60 / 1000);
var m = parseInt((time % (60 * 60 * 1000)) / 60 / 1000);
var s = parseInt((time % (60 * 1000)) / 1000);
blog_running_days.innerHTML = d;
blog_running_hours.innerHTML = h;
blog_running_mins.innerHTML = m;
blog_running_secs.innerHTML = s;
}
refresh_blog_running_time();
if (typeof bottomTimeIntervalHasSet == "undefined") {
var bottomTimeIntervalHasSet = true;
setInterval(function () {
refresh_blog_running_time();
}, 500);
}
</script>

banner下方小箭头滚动效果

  1. 打开 外观->主题文件编辑器
  2. 在右侧 主题文件 处找到 主题页眉(header.php文件)
  3. CTRL + F 查询关键字cover-scroll-down
  4. 内容替换为如下图片内容

image-20240612131459582

<i class="fa fa-angle-down" aria-hidden="true" id="pointer1"></i>
<i class="fa fa-angle-down" aria-hidden="true" id="pointer2"></i>
<i class="fa fa-angle-down" aria-hidden="true" id="pointer3"></i>

接着额外CSS(外观 >> 自定义 >> 额外CSS)添加

/* 滑动块 */
@keyframes up-down-move {
0% {
opacity:0;
transform:translate(-50%,-150px); 
}
50% {
opacity:1;
transform:translate(-50%,-130px); 
}
100% {
opacity:0;
transform:translate(-50%,-110px); 
}
}
 
.cover-scroll-down .fa-angle-down{
font-size: 3rem;
text-shadow: 0px 0px 8px #dc1111;
position:absolute;
transform: translate(-50%,-80px);
opacity:0;
}
 
.cover-scroll-down #pointer1{
animation: up-down-move 3s linear infinite;
 
}
 
.cover-scroll-down #pointer2{
animation: up-down-move 3s 1s linear infinite;
}
 
.cover-scroll-down #pointer3{
animation: up-down-move 3s 2s linear infinite;
}

站点功能概览下方Links功能

image-20240612131949039

  1. 打开 外观->主题文件编辑器
  2. 在右侧 主题文件 处找到 边栏(sidebar.php文件)
  3. 找到对应行
  4. 内容替换为如下图片内容

image-20240612132240705

<div class="site-friend-links">
<div class="site-friend-links-title"><i class="fa fa-fw fa-link"></i> Links</div>
<ul class="site-friend-links-ul">												
<li class="site-friend-links-item">
<a href="https://music.163.com/#/playlist?id=2179738992" rel="noopener" target="_blank"><i class="fa fa-music" aria-hidden="true"></i> Music</a></li>				
<li class="site-friend-links-item">
<a href="https://blog.csdn.net/qq_52089863" rel="noopener" target="_blank"><i class="fa fa-paper-plane" aria-hidden="true"></i> CSDN</a></li></ul></div>

额外CSS

外观 >> 自定义 >> 额外CSS

/*=========字体设置============*/

/*字体*/
@font-face {
font-family: myFont;
src:url('URL') format('woff2');
font-display: swap;
}

body,
.nav-link-inner--text {
font-family: myFont;
}

.navbar-brand {
font-size: 1.25rem;
font-weight: 100;
margin-right: 2rem;
padding-bottom: .1rem;
}

/*设置加粗字体颜色*/
strong {
    /*白天*/
    color: black;
}
html.darkmode strong {
    /*夜晚*/
    color: black;
}

/*说说预览模式的代码字体颜色*/
pre {
    /*白天*/
    color: #A7727D;
}
html.darkmode pre {
    /*夜晚*/
    color: #FAAB78;
}
 
/*文章标题字体大小*/
.post-title {
    font-size: 30px
}
 
/*正文字体大小(不包含代码)*/
.post-content p{
    font-size: 1.25rem;
}
li{
    font-size: 1.2rem;
}
 
/*评论区字体大小*/
p {
    font-size: 1.2rem
}
 
/*评论发送区字体大小*/
.form-control{
    font-size: 1.2rem
}
 
/*评论勾选项目字体大小*/
.custom-checkbox .custom-control-input~.custom-control-label{
    font-size: 1.2rem
}

/*评论区代码的强调色*/
code {
  color: rgba(var(--themecolor-rgbstr));
}
 
/*说说字体大小和颜色设置*/
.shuoshuo-title {
    font-size: 25px;
/*  color: rgba(var(--themecolor-rgbstr)); */
}
 
/*尾注字体大小*/
.additional-content-after-post{
    font-size: 1.2rem
}

/*========颜色设置===========*/
 
/*文章或页面的正文颜色*/
body{
    color:#364863
}

/*``引用颜色设置*/
code {
    color: #fb6340 !important;
}

li {
    color: black !important;
    font-weight: bold !important;
}

/*引文属性设置*/
blockquote {
border-left: 4px solid #607d8b!important;
    /*添加弱主题色为背景色*/
    background: rgba(var(--themecolor-rgbstr), 0.12) !important;
    width: 100%
}
 
/*引文颜色 建议用主题色*/
:root {
    /*也可以用类似于--color-border-on-foreground-deeper: #009688;这样的命令*/
    --color-border-on-foreground-deeper: rgba(var(--themecolor-rgbstr));
}
 
/*左侧菜单栏突出颜色修改*/
.leftbar-menu-item > a:hover, .leftbar-menu-item.current > a{
    background-color: #f9f9f980;
}

/*站点概览分隔线颜色修改*/
.site-state-item{
    border-left: 1px solid #aaa;
}
.site-friend-links-title {
    border-top: 1px dotted #aaa;
}
#leftbar_tab_tools ul li {
    padding-top: 3px;
    padding-bottom: 3px;
    border-bottom:none;
}
html.darkmode #leftbar_tab_tools ul li {
    border-bottom:none;
}


/*========排版设置===========*/
 
/*左侧栏层级置于上层*/
#leftbar_part1 {
    z-index: 1;
}

/*分类卡片文本居中*/
#content > div.page-information-card-container > div > div{
    text-align:center;
}

/*子菜单对齐及样式调整*/
.dropdown-menu .dropdown-item>i{
    width: 10px;
}
.dropdown-menu>a {
    color:var(--themecolor);
}
.dropdown-menu{
    min-width:max-content;
}
.dropdown-menu .dropdown-item {
    padding: .5rem 1.5rem 0.5rem 1rem;
}
.leftbar-menu-subitem{
    min-width:max-content;
}
.leftbar-menu-subitem .leftbar-menu-item>a{
    padding: 0rem 1.5rem 0rem 1rem;
}

/*左侧栏边距修改*/
.tab-content{
    padding:10px 0px 0px 0px !important;
}
.site-author-links{
    padding:0px 0px 0px 10px ;
}

/*目录位置偏移修改*/
#leftbar_catalog{
    margin-left: 0px;
}

/*目录条目边距修改*/
#leftbar_catalog .index-link{
    padding: 4px 4px 4px 4px;
}

/*左侧栏小工具栏字体缩小*/
#leftbar_tab_tools{
    font-size: 14px;
}

/*正文图片边距修改*/
article figure {margin:0;}
/*正文图片居中显示*/
.fancybox-wrapper {
    margin: auto;
}

/*正文表格样式修改*/
article table > tbody > tr > td,
article table > tbody > tr > th,
article table > tfoot > tr > td,
article table > tfoot > tr > th,
article table > thead > tr > td,
article table > thead > tr > th{
    padding: 8px 15px;
    border: 1px solid;
}

/*表格居中样式*/
.wp-block-table.aligncenter{margin:10px auto;}

/*========鼠标样式===========*/
body {
cursor: url(https://cdn.chenshiren.cool/images/202405141954908.cur), default;
}
 
/** 链接指针样式**/ 
a:hover{cursor:url(https://cdn.chenshiren.cool/images/202405141954895.cur), pointer;}
 


/*========背景样式===========*/
/*日间模式背景透明*/
.card{
background-color:rgba(255, 255, 255, 0.9) !important;
 
-webkit-backdrop-filter:blur(6px);
}
 
/*夜间模式背景透明*/
html.darkmode.bg-white,html.darkmode .card,html.darkmode #footer{
background:rgba(66, 66, 66, 0.9) !important;
}
html.darkmode #fabtn_blog_settings_popup{
background:rgba(66, 66, 66, 0.9) !important;
}
 
/*小工具栏背景透明*/
.card .widget,.darkmode .card .widget,#post_content > div > div > div.argon-timeline-card.card.bg-gradient-secondary.archive-timeline-title{
background-color:#ffffff00 !important;
backdrop-filter:none;
-webkit-backdrop-filter:none;
}
.emotion-keyboard,#fabtn_blog_settings_popup{
background-color:rgba(255, 255, 255, 0.95) !important;
}

/*顶栏标题放大*/
.navbar-nav .nav-link {
font-size: 1.2rem;
}
.navbar-brand {
font-size: 1.2rem;
margin-right: 0.5rem;
padding-bottom: .1rem;
}
.navbar-nav .nav-item {
margin-right:1;
}
.navbar-expand-lg .navbar-nav .nav-link {
padding-right: 0.9rem;
padding-left: 2rem;
}


leftbar_overview_author_image {
    width: 100px;
    height: 100px;
    margin: auto;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-color: rgba(127, 127, 127, 0.1);
    overflow: hidden;
    box-shadow: 0 0 5px rgba(116, 8, 204, 0.3);
    transition: transform 0.3s ease; /*变化速度*/
}

 /*头像放大*/
#leftbar_overview_author_image:hover {
	transform: scale(1.2); /*缩放大小*/
	filter: brightness(105%); /*调节亮度*/
}

/* 标题缩放 */
.banner-title{
	transition: .8s cubic-bezier(.2,.8,.2,1);
}
.banner-title:hover {
	transform:scale(1.2) translateY(-50%);
}

/* 作者名称 */
#leftbar_overview_author_name {
margin-top: 15px;
font-size: 18px;align-content;
color:#607d8b;
}

/* 作者名称自动缩放 */
#leftbar_overview_author_name {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
    transition: transform 0.3s ease; /*变化速度*/
}
#leftbar_overview_author_name:hover {
    transform: scale(1.2); /*缩放大小*/
    filter: brightness(110%); /*调节亮度*/
}

/* 简介 */
#leftbar_overview_author_description {
font-size: 14px;
margin-top: -4px;
opacity: 0.8;
color:#607d8b;
}

/* 滑动块 */
@keyframes up-down-move {
0% {
opacity:0;
transform:translate(-50%,-150px); 
}
50% {
opacity:1;
transform:translate(-50%,-130px); 
}
100% {
opacity:0;
transform:translate(-50%,-110px); 
}
}
 
.cover-scroll-down .fa-angle-down{
font-size: 3rem;
text-shadow: 0px 0px 8px #dc1111;
position:absolute;
transform: translate(-50%,-80px);
opacity:0;
}
 
.cover-scroll-down #pointer1{
animation: up-down-move 3s linear infinite;
 
}
 
.cover-scroll-down #pointer2{
animation: up-down-move 3s 1s linear infinite;
}
 
.cover-scroll-down #pointer3{
animation: up-down-move 3s 2s linear infinite;
}

页头脚本

特效地址

放在页头脚本中

# 点击爱心特效
<script type="text/javascript">
         ! function (e, t, a) {
            function r() {
                for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[
                        e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x +
                    "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e]
                    .scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
                requestAnimationFrame(r)
            }
 
            function n() {
                var t = "function" == typeof e.onclick && e.onclick;
                e.onclick = function (e) {
                    t && t(), o(e)
                }
            }
 
            function o(e) {
                var a = t.createElement("div");
                a.className = "heart", s.push({
                    el: a,
                    x: e.clientX - 5,
                    y: e.clientY - 5,
                    scale: 1,
                    alpha: 1,
                    color: c()
                }), t.body.appendChild(a)
            }
 
            function i(e) {
                var a = t.createElement("style");
                a.type = "text/css";
                try {
                    a.appendChild(t.createTextNode(e))
                } catch (t) {
                    a.styleSheet.cssText = e
                }
                t.getElementsByTagName("head")[0].appendChild(a)
            }
 
            function c() {
                return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math
                    .random()) + ")"
            }
            var s = [];
            e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e
                .mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
                    setTimeout(e, 1e3 / 60)
                }, i(
                    ".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"
                ), n(), r()
        }(window, document);
    </script>

页尾脚本

3D卡片效果

<!--回顶图标修改--><script>
$("#fabtn_back_to_top > span > i").removeClass("fa fa-angle-up");
$("#fabtn_back_to_top > span > i").addClass("fa fa-arrow-up");
</script>
 
<!--卡片3D效果脚本--><script src="https://cdn.jsdelivr.net/gh/huangwb8/bloghelper/vanilla3D/vanilla-tilt.min.js"></script>
<!--判断是否为Safari浏览器--><script>var isSafari = /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);</script>
 
<!--以下内容每次跳转新页面都执行,pjax额外处理--><script>
window.pjaxLoaded = function () {
    //站点概览点击头像或作者名跳转到关于页
    $("#leftbar_overview_author_image").wrapAll('<a href="/about" /a>');
    $("#leftbar_overview_author_name").wrapAll('<a href="/about" /a>');
   
    //卡片3D效果
    if (screen.width >= 768 && !isSafari) {
        VanillaTilt.init(document.querySelectorAll("article.post:not(.post-full), .shuoshuo-preview-container"), {
            reverse: true,  // reverse the tilt direction
            max: 8,     // max tilt rotation (degrees)
            startX: 0,      // the starting tilt on the X axis, in degrees.
            startY: 0,      // the starting tilt on the Y axis, in degrees.
            perspective: 1000,   // Transform perspective, the lower the more extreme the tilt gets.
            scale: 1.02,      // 2 = 200%, 1.5 = 150%, etc..
            speed: 600,    // Speed of the enter/exit transition
            transition: false,   // Set a transition on enter/exit.
            axis: "y",    // What axis should be banned. Can be "x", "y", or null
            reset: true,   // If the tilt effect has to be reset on exit.
            easing: "cubic-bezier(.03,.98,.52,.99)",    // Easing on enter/exit.
            glare: false,  // if it should have a "glare" effect
            "max-glare": 0.8,      // the maximum "glare" opacity (1 = 100%, 0.5 = 50%)
            "glare-prerender": false,  // false = VanillaTilt creates the glare elements for you, otherwise
            // you need to add .js-tilt-glare>.js-tilt-glare-inner by yourself
            "mouse-event-element": null,   // css-selector or link to HTML-element what will be listen mouse events
            gyroscope: true,   // Boolean to enable/disable device orientation detection,
            gyroscopeMinAngleX: -45,    // This is the bottom limit of the device angle on X axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the left border of the element;
            gyroscopeMaxAngleX: 45,     // This is the top limit of the device angle on X axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the right border of the element;
            gyroscopeMinAngleY: -45,    // This is the bottom limit of the device angle on Y axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the top border of the element;
            gyroscopeMaxAngleY: 45,     // This is the top limit of the device angle on Y axis, meaning that a device rotated at this angle would tilt the element as if the mouse was on the bottom border of the element;
        })
    }
}
window.pjaxLoaded();
</script>

Argon主题美化参考文档:

Argon主题美化 - 北冥红烧鱼的芥子空间 (hongshaoyv.com)

Argon主题博客美化 – Echo小窝 (liveout.cn)

Docker系列 WordPress系列 特效 - Bensz (hwb0307.com)

错误解决

413 request Entity too Large

配置参数:
​ 1)配置请求体缓存区大小
​ client_body_buffer_size 10m;2)配置客户端请求体最大值
​ client_max_body_size 20m;3)设置临时文件存放路径(可选配置)
​ client_body_temp_path /data/temp;
​ ps:设置临时文件存放路径。只有当上传的请求体超出缓存区大小时,才会写到临时文件 中,注意临时路径要有写入权限
配置设置:
​ 1)在http{ }中设置:client_max_body_size 20m;2)选择在server{ }中设置:client_max_body_size 20m;3)选择在location{ }中设置:client_max_body_size 20m;
​ 区别:http{} 中控制着所有nginx收到的请求;而报文大小限制设置在server{}中,则控制该 server收到的请求报文大小,同理,如果配置在location中,则报文大小限制,只对匹 配了location 路由规则的请求生效。
  • http{}中输入

    设置到http{}内,控制全局nginx所有请求报文大小

#配置客户端请求体最大值
client_max_body_size 20M;
#配置请求体缓存区大小
client_body_buffer_size 10m;
  • server{}中输入

    设置到server{}内,控制该server的所有请求报文大小

#配置客户端请求体最大值
client_max_body_size 20M;
#配置请求体缓存区大小
client_body_buffer_size 10m;
  • location{}中输入

    设置到location{}内,控制满足该路由规则的请求报文大小

#配置客户端请求体最大值
client_max_body_size 20M;
#配置请求体缓存区大小
client_body_buffer_size 10m;

此内容报错来自:https://blog.csdn.net/ludp1997/article/details/114256809

设置http响应头Cache-Control及Pragma,增加CDN cache命中率

最近在折腾 [CDN cache](http://www.dnsdizhi.com/cdncache.html) 命中率。然后就发现在伪静态环境下, [cdn](http://www.dnsdizhi.com/cdn/) 缓存命中率非常低,一番折腾后发现如果源站的http头部包含一些不缓存的信息,那么CDN”也许“会相应的继承源站发出的HTTP状态。
通常喜欢用军哥LNMP安装包的朋友会发现,在动态及伪静态的环境中,HTTP头部信息会包含Cache-Control: no-store,no-cache,must-revalidate,post-check=0,pre-check=0 和 Pragma: no-cache,“可能“就是这种状态影响了CDN对源站缓存的判断。

如何去掉Cache-Control及Pragma在http头部中的状态呢?
如果没有看到此文的话,你会非常痛苦的认为是网站程序本身所发出的状态,然后一番查找修改后发现依然无解,我理解这个过程,因为我就是这么干的。非常之痛苦。。。。

其实解决Cache-Control: no-store,no-cache.....和Pragma: no-cache很简单,只需修改php.ini中的session.cache_limiter参数,军哥lnmp默认值是nocache,只要修改为none即可解决这个HTTP状态中的缓存问题。耶!耶!耶!耶!耶~~~~~~~~~
session.cache_limiter = nocache
改为 
session.cache_limiter = none
重启apache

此内容来源于:http://www.dnsdizhi.com/cdncache.html

wordpress更改固定链接模式后前台文件打开404

首先更改wordpress固定链接

Nginx环境

vim /你的Nginx安装目录/conf/nginx.conf

# 添加如下代码
if (-f $request_filename/index.html){
    rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
    rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
    rewrite (.*) /index.php;
}

# 重启nginx
systemctl restart nginx

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/713710.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

GitHub Copilot 登录账号激活,已经在IntellJ IDEA使用

GitHub Copilot 想必大家都是熟悉的&#xff0c;一款AI代码辅助神器&#xff0c;相信对编程界的诸位并不陌生。 今日特此分享一项便捷的工具&#xff0c;助您轻松激活GitHub Copilot&#xff0c;尽享智能编码之便利&#xff01; GitHub Copilot 是由 GitHub 和 OpenAI 共同开…

38、基于卷积神经网络(CNN)的车牌自动识别系统(matlab)

1、原理及流程 1&#xff09;原理 CNN&#xff08;卷积神经网络&#xff09;是一种深度学习模型&#xff0c;可以用于图像识别和分类任务。车牌自动识别系统的原理基本上就是使用CNN模型对车牌图像进行处理和识别。 首先&#xff1a;系统需要收集大量的含有车牌的图像数据作…

windows系统,家庭自用NAS。本地局域网 Docker安装nextcloud

windows系统&#xff0c;家庭自用NAS。本地局域网 Docker安装nextcloud 1、docker安装 太简单了&#xff0c;直接去搜一搜。 docker-compose 相关命令 docker-compose down docker compose up -d2、还是使用老的 在你需要挂载的目录下&#xff0c;新建一个文件&#xff0c;…

航顺MCU概览

前言: 截止2023年底,全国有3451家芯片设计公司,已经IPO的就有168家,尚未IPO的3283家中超过一半的年营收在1000万以下,迅猛发展的几年的确有些国产芯片开始站上赛道,这也是国际大背景下的一种必然选择,毕竟突然间出现的大市场需要国产顶上,但资本市场是周期性的,国产替…

港科夜闻 | 香港科大与香港科大(广州)合推红鸟跨校园学习计划,共享教学资源,促进港穗学生交流学习...

关注并星标 每周阅读港科夜闻 建立新视野 开启新思维 1、香港科大与香港科大(广州)合推“红鸟跨校园学习计划”&#xff0c;共享教学资源&#xff0c;促进港穗学生交流学习。香港科大与香港科大(广州)6月14日共同宣布推出“红鸟跨校园学习计划”&#xff0c;以进一步加强两校学…

transformer和Non-local

两者本质上是一个东西&#xff0c;都是用来求自注意力的&#xff0c;但具体而言还是有一些差别&#xff1b; 1&#xff1a;首先说Non-local&#xff0c;它是像素级别的self-attention,算的是图片中各个像素点对指定像素点的影响&#xff1b; 2&#xff1a;transformer我们拿s…

算法人生(22):从“生成对抗网络”看“逆商提升”

​ 在图像生成与编辑、音频合成、视频生成领域里&#xff0c;有一个非常重要的深度学习方法——生成对抗网络&#xff08;简称GANs&#xff09;&#xff0c;它是由两个神经网络组成的模型&#xff0c;分别为生成器&#xff08;Generator&#xff09;和判别器&#xff08;Discr…

移动硬盘数据恢复方法哪个好?六个硬盘恢复,新手也能用!

移动硬盘数据恢复方法哪个好&#xff1f;移动硬盘&#xff0c;作为我们存储重要数据的常用设备&#xff0c;一旦里面的视频、文档、音频等资料突然消失&#xff0c;确实会令人烦恼和担忧。然而&#xff0c;因为数据丢失的原因可能多种多样&#xff0c;因此恢复方法也会有所不同…

【嵌入式DIY实例】-Nokia 5110显示DS3231 RTC数据

Nokia 5110显示DS3231 RTC数据 文章目录 Nokia 5110显示DS3231 RTC数据1、硬件准备与接线2、代码实现本文将介绍如何使用 ESP8266 NodeMCU 板和 DS3231 RTC 模块制作一个简单的数字实时时钟,其中可以使用连接到 NodeMCU 的两个按钮设置时间和日期,并将它们打印在诺基亚 5110 …

Ubuntu server 24 (Linux) 新增磁盘 lvm 动态扩容磁盘空间

1 新增一块硬盘 #查看 sudo fdisk -l #重新分区&#xff0c;转换成lvm类型 sudo fdisk /dev/sdb 2 查看磁盘 df -h3 lvm 配置 #查看lvm逻辑卷 sudo lvdisplay #创建物理卷 sudo pvcreate /dev/sdb1 #扩展卷组 sudo vgextend ubuntu-vg /dev/sdb1 #扩展逻辑卷 sudo lvexte…

【Linux】pycharmgit相关操作

目录 1. git安装配置2. 相关内容3. pycharm连接远程仓库3.1 配置3.2 clone远程仓库3.3 本地仓库上传远程 4. 分支管理4.1 更新代码4.2 新建分支4.3 分支合并4.4 代码比对 5. 版本管理6. 命令行操作6.1 配置git6.2 基础操作6.3 分支操作 1. git安装配置 下载链接&#xff1a;官…

从数据库到数据仓库:数据仓库导论

导言 本文为数据仓库导论&#xff0c;旨在介绍数据仓库的基本理念和应用场景&#xff0c;帮助读者理解数据仓库的重要性及其在企业中的实际应用。 数据仓库作为重要的数据管理和分析工具&#xff0c;已经发展了30多年&#xff0c;其过程中生态和技术都发生了巨大的变化。尽管…

1832javaERP管理系统之能力物料管理Myeclipse开发mysql数据库servlet结构java编程计算机网页项目

一、源码特点 java erp管理系统之能力物料管理是一套完善的web设计系统&#xff0c;对理解JSP java编程开发语言有帮助采用了serlvet设计&#xff0c;系统具有完整的源代码和数据库&#xff0c;系统采用web模式&#xff0c;系统主要采用 B/S模式开发。开发环境为TOMCAT7.0,My…

深入理解指针(四)

目录 1. 回调函数是什么? ​2. qsort使用举例 2.1冒泡排序 2.2使用qsort函数排序整型数据 ​2.3 使用qsort排序结构数据(名字) 2.4 使用qsort排序结构数据(年龄) 3. qsort函数的模拟实现 1. 回调函数是什么? 回调函数就是⼀个通过函数指针调⽤的函数。 如果你把函数…

CSS概述

CSS是一种样式表语言&#xff0c;用于为HTML文档控制外观&#xff0c;定义布局。例如&#xff0c; CSS涉及字体、颜色、边距、高度、宽度、背景图像、高级定位等方面 。 ● 可将页面的内容与表现形式分离&#xff0c;页面内容存放在HTML文档中&#xff0c;而用 于定义表现形式…

第五十七周:文献阅读

目录 摘要 Abstract 文献阅读&#xff1a;基于遗传算法的PM2.5时间序列预测深度学习模型超参数优化 一、现有问题 二、提出方法 三、方法论 1、HPO&#xff08;猎人猎物算法&#xff09; 2、深度学习算法 递归神经网络&#xff08;RNN&#xff09; LSTM GRU 3、GA…

20240613日志:COPAL

Location: Beijing 1 大模型剪枝 Fig. 1.1大模型压缩-剪枝 剪枝的分类&#xff1a;结构化修剪对于简化大型语言模型和提高其效率尤其相关。非结构化修剪关注的是选择性地去除单个权重&#xff0c;旨在消除网络中不那么关键的连接。 修剪的基于阶段的分类&#xff1a;修剪可以在…

解决Pycharm远程连接WSL2的python解释器,使用调试模式时显示超时的问题

环境 windows 11wsl2ubuntu20.04pycharm2023.3.3 问题 Pycharm远程连接WSL2的python解释器&#xff0c;使用调试模式时显示超时 分析 TCP连接错误。 解决方法 windows高级防火墙设置->入站规则->找到pycharm2023.3.3的TCP连接规则->双击允许连接 步骤截图见下…

【C语言】解决C语言报错:Use of Uninitialized Variable

文章目录 简介什么是Use of Uninitialized VariableUse of Uninitialized Variable的常见原因如何检测和调试Use of Uninitialized Variable解决Use of Uninitialized Variable的最佳实践详细实例解析示例1&#xff1a;局部变量未初始化示例2&#xff1a;数组未初始化示例3&…

Explain Python Machine Learning Models with SHAP Library

Explain Python Machine Learning Models with SHAP Library – Minimatech &#xff08;能翻墙直接看原文&#xff09; Explain Python Machine Learning Models with SHAP Library 11 September 2021Muhammad FawiMachine Learning Using SHapley Additive exPlainations …