网页添加访问密码/nginx隐藏真实地址 - 汇站网

网页添加访问密码/nginx隐藏真实地址

2022-08-08 0 817

教程前言:

一款简单的网页访问密码,当然只是简单的限制访问,配合nginx 隐藏真实地址后不定型期修改伪地址效果更加哦!

 

代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
        <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    </head>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
            outline: none;
            box-sizing: border-box;
        }
        body{
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background: linear-gradient(135deg,#56c8ff,#6f99fc) no-repeat;

        }
        .wrapper{
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 450px;
            background-color: #fff;
            padding: 30px;
            box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
        }
        .wrapper .input-data{
            width: 100%;
            height: 40px;
            position: relative;
        }
        .wrapper .input-data input{
            width: 100%;
            height: 100%;
            border: none;
            border-bottom: 2px solid silver;
            font-size: 15px;
        }
        .input-data input:focus ~ label,
        .input-data input:valid ~ label{
            transform: translateY(-20px);
            font-size: 15px;
            color: #4158D0;
        }
        .wrapper .input-data label{
            position: absolute;
            bottom: 10px;
            left: 0;
            color: grey;
            pointer-events: none;
            transition: all 0.3s ease;
        }
        .wrapper .input-data .underline{
            position: absolute;
            bottom: 0px;
            height: 2px;
            width: 100%;
        }
        .input-data .underline:before{
            position: absolute;
            content: "";
            height: 100%;
            width: 100%;
            background: #1E90FF;
            transform: scaleX(0);
            transition:transform 0.3s ease;
        }
        .input-data input:focus ~ .underline:before,
        .input-data input:valid ~ .underline:before{
            transform: scaleX(1);
        }
        .send-btn {
            position: relative;
            background-color: #1E90FF;
            border: none;
            font-size: 15px;
            color: #ffffff;
            padding: 8px;
            width: 150px;
            text-align: center;
            transition-duration: 0.6s;
            text-decoration: none;
            overflow: hidden;
            cursor: pointer;
            border-radius: 5px;
            margin-top: 20px;
        }
        .send-btn::after {
            content: '';
            background: #53a4f0;
            display: block;
            position: absolute;
            padding-top: 300%;
            padding-left: 350%;
            margin-left: -20px !important;
            margin-top: -120%;
            opacity: 0;
            transition: all 0.8s;
        }
        .send-btn:active::after {
            padding: 0;
            margin: 0;
            opacity: 1;
            transition: 0s;
        }
    </style>
    <body>
        <form action="/token.php" method="post">
            <div class="wrapper">
                <div class="input-data">
                    <input type="text" name="token"/>
                    <div class="underline"></div>
                    <label>访问密码</label>
                </div>
                <button class="send-btn">进入</button>
            </div>
        </form>
    </body>
</html>
<?php
    header("content-type:text/html;charset=utf-8");
     // 接收令牌字段
    $url_token = $_POST['token'];
    // 自定义令牌
    $custom_token = 'jiuyan';
    // 密码正确跳转地址
    $request_path = "/usa";
    // 验证密码
    if($url_token == $custom_token) {
        header("Location: $request_path");
    }
?>

 

 

伪地址 usa 例如访问 /usa 就等于/index.html:

# 伪地址 usa 例如访问 /usa 就等于/index.html
location ~* ^/usa {
      proxy_next_upstream error timeout http_503 http_504 http_502;
      proxy_connect_timeout 500s;
      proxy_read_timeout 500s;
      proxy_send_timeout 500s;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      # 需要跳转的地址,例如:/index.html,/index.php
      rewrite  ^(.*)$  /index.html break;
      # 跳转的域名
      proxy_pass https://www.huizhanii.com;
}

 

转载请注明:汇站网 » 网页添加访问密码/nginx 隐藏真实地址

收藏 (0)

微信扫一扫

支付宝扫一扫

点赞 (0)

感谢您的来访,获取更多精彩资源请收藏本站。

本站声明

本资源仅用于个人学习和研究使用,禁止用于任何商业环境!

 1.  本网站名称:汇站网
 2.  本站永久网址:https://www.huizhanii.com/
 3.  本站所有资源来源于网友投稿和高价购买,所有资源仅对编程人员及源代码爱好者开放下载做参考和研究及学习,本站不提供任何技术服务!
 4.  未经原版权作者许可,禁止用于任何商业环境,任何人不得擅作它用,下载者不得用于违反国家法律,否则发生的一切法律后果自行承担!
 5.  为尊重作者版权,请在下载24小时内删除!请购买原版授权作品,支持你喜欢的作者,谢谢!
 6.  若资源侵犯了您的合法权益, 请持您的版权证书和相关原作品信息来信通知我们请来信     通知我们我们会及时删除,给您带来的不便,我们深表歉意!
 7.  如下载链接失效、广告或者压缩包问题请联系站长处理!
 8.  如果你也有好源码或者教程,可以发布到网站,分享有金币奖励和额外收入!
 9.  本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
 10.  因源码具有可复制性,一经赞助 ,不得以任何形式退款。
 11.  更多详情请点击查看

汇站网 技术安全 网页添加访问密码/nginx隐藏真实地址 https://www.huizhanii.com/28582.html

汇站

站长资源下载中心-找源码上汇站

常见问题
  • 如果付款后没有弹出下载页面,多刷新几下,有问题联系客服!
查看详情
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。
查看详情

相关文章

发表评论
暂无评论
  随机评论 表情开关按钮图片
表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情表情
登录后评论
联系官方客服

为您解决烦忧 - 24小时在线 专业服务

(汇站网)一个专注站长资源的平台网站,提供最新的网站模板和整站源码,内容包含各类精品网页模板,企业网站模板,网站模板,DIV+CSS模板,织梦模板,帝国cms模板,discuz模板,wordpress模板,个人博客论坛模板,上千种免费网页模板下载尽在汇站网.找源码上汇站.huizhanii.com

终身SVIP限时特惠


为回馈新老会员对本站的支持与厚爱

推出原价598元 现在仅需99元 有效期为永久

可享有免费下载本站98%VIP资源

即时活动 即时优惠 错过就再等一年

汇站网(huizhanii.com)

2024年即日


点我关闭