几个常用 Nginx 规则

# 防止tpl inc cfg文件被下载 
        location ~* .(tpl|inc|cfg)$ { 
        deny all;
        }
# 套用CDN的情况返回真实IP
        add_header X-Real-IP $http_x_real_ip;
        set_real_ip_from 0.0.0.0/0;
        real_ip_header X-Real-IP;
        real_ip_recursive on;
# SSL反代
server
    {
     listen 443;
      server_name www.815494.com 815494.com;
      #rewrite ^/(.*) https://$server_name$1 permanent;
      ssl on;
      ssl_certificate /root/#PEM/CRT;
      ssl_certificate_key /root/#KEY;
      #               ssl_protocols SSLv2 SSLv3 TLSv1;
       #              ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
        #             ssl_prefer_server_ciphers on;
     #listen 80;
      location / {
      proxy_redirect www.B.com /;
      proxy_pass https://www.B.com;
      proxy_set_header Accept-Encoding "";
      proxy_set_header User-Agent $http_user_agent;
      proxy_set_header Accept-Language "zh-CN";
      proxy_set_header X-Real-IP $remote_addr;

    }
    }
 
server
    {
     listen 80;
      server_name www.815494.com 815494.com;
      rewrite ^(.*) https://$server_name$1 permanent;
    }

人已赞赏
运维笔记

Windows Server 2012 配置指南 之 系统语言汉化篇

2018-6-5 15:56:29

运维笔记

如何强制卸载阿里云盾(安骑士)监控及屏蔽云盾IP检测&附带教程

2018-8-17 10:58:53

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索