===============
== ffff65535 ==
===============
十六个一[1111111111111111]

ghost+nginx无限重定向

ghost nginx

修改ngixn配置

server
{
    listen 80;
		listen 443 ssl http2;
    server_name ghost.你的域名.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/ghost.你的域名.com;
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #HTTP_TO_HTTPS_START
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    #HTTP_TO_HTTPS_END
    ssl_certificate    /www/server/panel/vhost/cert/ghost.你的域名.com/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/ghost.你的域名.com/privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
    error_page 497  https://$host$request_uri;

    #SSL-END
    
    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
    
    #PHP-INFO-START  PHP引用配置,可以注释或修改
    

		include enable-php-00.conf;
    #PHP-INFO-END

    # 拦截请求,直接返回上传的静态图片资源,缓存时间 1 个月
    location ^~ /content/images {
        alias /www/ghost_site/content/images;
        expires 1M;
        access_log off;
        add_header Cache-Control "public";
    }
    location ~ ^/(image|javascript|js|css|media|static)/ {
        proxy_pass http://127.0.0.1:2368;
        # root /www/ghost.qinan.co/web/static/;
        access_log off;
        expires 30d;
    }
    # 不缓存 ghost 核心文件(反向代理后台管理)
    location ^~ /ghost/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2368;
    }

    # favicon
    location = /favicon.ico {
        root /www/ghost_site/core/shared;
        access_log off;
        log_not_found off;
        expires 30d;
    }

    # cache urls
    # 反向代理博客请求到服务端
    location / {
        proxy_cache_valid 200 60m;
        proxy_cache_bypass    $http_cache_control;
        proxy_redirect off;
        add_header X-Proxy-Cache $upstream_cache_status;
        proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
        # 后端的Web服务器可以通过X-Forwarded-For获取用户真实IP
        proxy_set_header Host   $host;
        proxy_set_header X-Real-IP    $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto    https;
        proxy_set_header X-Forwarded-Host    $host;
        proxy_pass http://127.0.0.1:2368;
        proxy_max_temp_file_size 0;
        proxy_connect_timeout 90;
        proxy_send_timeout 90;
        proxy_read_timeout 90;
        proxy_buffering off;
        proxy_temp_file_write_size 64k;
    }

    location ~ /\.
    {
        deny all;
    }

    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/ghost.你的域名.com.conf;
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }
    
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log /dev/null;
        access_log /dev/null;
    }
    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log /dev/null;
        access_log /dev/null;
    }
		access_log  /www/wwwlogs/ghost.你的域名.com.log;
    error_log  /www/wwwlogs/ghost.你的域名.com.error.log;
}

参考资料:

https://ghost.qinan.co/xiu-fu-nginx-ghost-wu-xian/

感谢大佬的文章