Skip to content

Latest commit

 

History

History
59 lines (53 loc) · 1.71 KB

23.05.md

File metadata and controls

59 lines (53 loc) · 1.71 KB

23.05版本配置文件

  1. nginx+clash.config 使用nginx作为web服务器,同时加入openclash 注意:nginx默认强制使用https(ssl),需要自行修改 以下为取消https强制跳转 在 /etc/nginx/conf.d 中创建一个 web.conf 文件(web为文件名称,随意)
server {
    listen 80 default_server;
    isten [::]:80 default_server;
    server_name _lan;
    include restrict_locally;
    include 'conf.d/*.locations';
    access_log off; # logd openwrt
}    

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name _ssl;
    include 'conf.d/*.locations';
    ssl_certificate '/etc/nginx/conf.d/_lan.crt';        
    ssl_certificate_key '/etc/nginx/conf.d/_lan.key';    
    ssl_session_cache 'shared:SSL:32k';
    ssl_session_timeout '64m';
    access_log off; # logd openwrt
}

以下为内网http,外部使用域名并强制跳转https
除了上述web.conf外,在创建一个https.conf

server {
    listen 80;
    listen [::]:80;
    server_name xxx;    #xxx为域名
    return 302 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name xxx;    #xxx为域名
    include 'conf.d/*.locations';
   
    ssl_certificate '/etc/nginx/conf.d/_lan.crt';            #证书文件
    ssl_certificate_key '/etc/nginx/conf.d/_lan.key';        #证书文件
    
    ssl_session_cache 'shared:SSL:32k';
    ssl_session_timeout '64m';
    
    ssl_ciphers HIGH:!aNULL:MD5;
    ssl_prefer_server_ciphers on;
    access_log off; # logd openwrt
    }

使用https是,ttyd终端需配置ssl,否则在https下无法显示

  1. uhttp.config 使用uhttp作为web服务器,默认没有openclash,无需其他设置即可直接使用