刘小帅

配置跳转
server { listen 80; ...
扫描右侧二维码阅读全文
28
2019/10

配置跳转

        server {
                listen       80;
                listen       443 ssl;
                server_name  baidu.com www.baidu.com;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
        
            if ($scheme = http ) {
            return 301 https://$host$request_uri;
                }
                return 301 https://google.com$request_uri;
        
            ssl_certificate_key /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.key;
                ssl_certificate /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.nginx.crt;
        }

    server {
            listen       80;
            listen       888 ssl;
            listen       443 ssl;
            server_name  baidu.com www.baidu.com;       
            root         /software/baidu.com;
        charset      utf-8;
            index        index.html;
    
            if ( $server_port = 80 ) {
        return 301 https://$host$request_uri;
            }
    
        ssl_certificate_key /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.key;
            ssl_certificate /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.nginx.crt;
    }

    server {
            listen       80;
            server_name  *.cn;
            charset      utf-8;
            root         /software/*.cn;
            index        index.html;
    
            location =/ {
                if ($arg_shareName = ""){
                    rewrite ^ http://$host/index.html?shareName=111 break;
                }
            }
    }
    
    $arg_后面跟你要统计的字段名字



    server {
            listen       80;
            listen       443 ssl;
            server_name  baidu.com www.baidu.com;
            root /software/baidu.com;
    
            # HSTS
            add_header  Strict-Transport-Security  "max-age=31536000";
            add_header  X-Frame-Options  deny;
            add_header  X-XSS-Protection "1";
    
        ssl_certificate_key /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.key;
        ssl_certificate /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.nginx.crt;
        rewrite ^ https://www.google.com break;






upstream baidu.com {
        server localhost:91;
        server localhost:92;
        server localhost:93;
        server localhost:94;
        server localhost:95;
    }
server {
        listen       80 ;
        listen       443 ssl;
        server_name  baidu.com;
        #root         /software/baidu广告/baidu.com;
        charset      utf-8;
        index        index.html index.htm;
        if ($scheme = http ) {
        return 301 https://$host$request_uri;
        }
        ssl_certificate_key /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.key;
        ssl_certificate /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.nginx.crt;
}
server {
        listen       80 ;
        listen       443 ssl;
        server_name  www.baidu.com;
        if ($scheme = http ) {
        return 301 https://$host$request_uri;
        }
        location / {
                proxy_pass http://baidu.com;
        }
        ssl_certificate_key /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.key;
        ssl_certificate /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.nginx.crt;
}
server {
        listen       91;
        server_name  localhost;
        if ($arg_c != '' ){
                rewrite ^/ https://www.baidu.com/?c=$arg_c? permanent;
        }
        location / {
                rewrite ^/ https://baidu.com/? permanent;
        }
}
server {
        listen       92;
        server_name  localhost;
        if ($arg_c != '' ){
                rewrite ^/ https://www.baidu.com/?c=$arg_c? permanent;
        }
        location / {
                rewrite ^/ https://baidu.com/? permanent;
        }
}
server {
        listen       93;
        server_name  localhost;
        if ($arg_c != '' ){
                rewrite ^/ https://www.baidu2.com/?c=$arg_c? permanent;
        }
        location / {
                rewrite ^/ https://baidu.com/? permanent;
        }
}
server {
        listen       94;
        server_name  localhost;
        if ($arg_c != '' ){
                rewrite ^/ https://www.baidu.com/?c=$arg_c? permanent;
        }
        location / {
                rewrite ^/ https://baidu.com/? permanent;
        }
}
server {
        listen       95;
        server_name  localhost;
        if ($arg_c != '' ){
                rewrite ^/ https://www.baidu.com/?c=$arg_c? permanent;
        }
        location / {
                rewrite ^/ https://baidu.com/? permanent;
        }
}
     

   
server {
        listen 80;
        server_name aaa.google.cc;

        if ( $uri != /google666adminmanager ){

               rewrite ^/(.*) https://$server_name:8000 break ;

          }

        if ($uri = /google666adminmanager ) {

                rewrite ^/(.*) https://$server_name:8000/#/serverIndex permanent;
        }

}


server {
        listen       80;
        server_name  baidu.com www.baidu.com;

        return 301 https://$server_name$request_uri;
}

server {
        listen       443 ssl;
        server_name  baidu.com www.baidu.com;
        # HSTS
        add_header  Strict-Transport-Security  "max-age=31536000";
        add_header  X-Frame-Options  deny;
        add_header  X-XSS-Protection "1";

        ssl_certificate_key /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.key;
        ssl_certificate /etc/nginx/conf/域名证书/baidu.com/Nginx/baidu.com.nginx.crt;

        if ($arg_channelCode != "") {
            rewrite ^/(.*) https://www.google.com/$1 break;
        }

        #rewrite ^/(.*) https://www.google.com?channelCode=30000 break;
        rewrite ^/(.*) https://www.google.com/?channelCode=1010 break;
}
server {
        listen       80;
        listen       443 ssl;
        server_name  123.com;
        root /software/123.com;
        # HSTS
        #add_header  Strict-Transport-Security  "max-age=31536000";
        #add_header  X-Frame-Options  deny;
        #add_header  X-XSS-Protection "1";


        ssl_certificate_key /etc/nginx/conf/域名证书/123.com/Nginx/123.com.key;
        ssl_certificate /etc/nginx/conf/域名证书/123.com/Nginx/123.com.nginx.crt;

        location = / {

        if ($scheme = http ) {

            return 301 https://$host$request_uri;
}

        if ($arg_channelCode = "") {
            rewrite ^/(.*) https://www.123.com/?channelCode=1021 break;
        }
            rewrite ^/(.*) https://www.123.com/$1 break;

    }

}

server {
        listen       80;
        listen       443 ssl;
        server_name  www.123.com;
        root /software/123.com;
        # HSTS
        #add_header  Strict-Transport-Security  "max-age=31536000";
        #add_header  X-Frame-Options  deny;
        #add_header  X-XSS-Protection "1";


        ssl_certificate_key /etc/nginx/conf/域名证书/123.com/Nginx/123.com.key;
        ssl_certificate /etc/nginx/conf/域名证书/123.com/Nginx/123.com.nginx.crt;

}
Last modification:December 13th, 2019 at 09:02 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment