A8DOG

A8DOG

随便写写,记录折腾过程!
telegram

宝塔Nginx反向代理Cloudflare(CF)的https站点

#PROXY-START/
location  ~* \.(php|jsp|cgi|asp|aspx)$
{
    proxy_pass https://你的域名;
    proxy_set_header Host 你的域名;
    #向后端传递访客 ip
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    #向后端传递访客 ip
   
    proxy_ssl_name 你的域名;
    proxy_ssl_server_name on;
 
}
location /
{
    proxy_pass https://你的域名;
    proxy_set_header Host 你的域名;
    #向后端传递访客 ip
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    #向后端传递访客 ip
   
    proxy_ssl_name 你的域名;
    proxy_ssl_server_name on;
 
 
    #缓存设置
    add_header X-Cache $upstream_cache_status;
        #Set Nginx Cache
 
    proxy_ignore_headers Set-Cookie Cache-Control expires;
    proxy_cache cache_one;
    proxy_cache_key $host$uri$is_args$args;
    proxy_cache_valid 200 304 301 302 120m;
    expires 12h;
}
 
#PROXY-END/
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.