每当我添加新站点、添加用户等时,WordPress都会返回“您关注的链接已过期”错误页面

时间:2018-11-15 作者:user1234

我有一个Wordpress多站点(子域)实例运行在一个VPS上,它似乎按照预期工作,无论何时我添加一个用户或添加一个站点,都会返回“您关注的链接已过期”页面,并发生一些事情。

我使用Nginx和php7.2-fpm。

这里是配置文件:

server {
        listen 80;
        server_name www.domain.name domain.name *.domain.name;

        return 301 https://www.domain.name$request_uri;
}

server {
        listen 443 ssl;
        server_name domain.name;

        ssl_certificate /etc/letsencrypt/live/domain.name/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/domain.name/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

        return 301 https://www.domain.name$request_uri;
}

server {
        listen 443 ssl;
        server_name www.domain.name;

        root /var/www/wordpress;

    access_log /var/log/nginx/domain.name.access.log;
    error_log /var/log/nginx/domain.name.error.log;

        ssl_certificate /etc/letsencrypt/live/domain.name/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/domain.name/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    include global/common.conf;

    # WORDPRESS : Rewrite rules, sends everything through index.php and keeps the appended query string intact
    location / {
            try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    # SECURITY : Deny all attempts to access PHP Files in the uploads directory
    location ~* /(?:uploads|files)/.*\\.php$ {
            deny all;
    }
    # REQUIREMENTS : Enable PHP Support
    location ~ \\.php$ {
        # SECURITY : Zero day Exploit Protection
            try_files $uri =404;
            # ENABLE : Enable PHP, listen fpm sock
            fastcgi_split_path_info ^(.+\\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/php7.2-fpm-www.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    # PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
    rewrite ^/sitemap_index\\.xml$ /index.php?sitemap=1 last;
    rewrite ^/([^/]+?)-sitemap([0-9]+)?\\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
}
全局/通用。形态:

# Global configuration file.
# ESSENTIAL : Configure Nginx Listening Port
listen 80;
# ESSENTIAL : Default file to serve. If the first file isn\'t found, 
index index.php index.html index.htm;
# ESSENTIAL : no favicon logs
location = /favicon.ico {
    log_not_found off;
    access_log off;
}
# ESSENTIAL : robots.txt
location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}
# ESSENTIAL : Configure 404 Pages
error_page 404 /404.html;
# ESSENTIAL : Configure 50x Pages
error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/www;
    }
# SECURITY : Deny all attempts to access hidden files .abcde
location ~ /\\. {
    deny all;
}
# PERFORMANCE : Set expires headers for static files and turn off logging.
location ~* ^.+\\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
    access_log off; log_not_found off; expires 30d;
}
我试图在网上找到解决方案,但什么都找不到。谢谢你的帮助!

1 个回复
SO网友:tradesouthwest

我也在寻找这个错误的答案。我能找到的最接近的是,它要么是插件中特定于插件的权限设置,要么是无效的nonce。请参见:Getting "The link you followed has expired" when adding custom post

结束

相关推荐

如何将php添加到主题以显示alt属性

我正试图找出如何将PHP/代码添加到模板中,以便在图像中显示alt标记。这个主题已经被一家不再存在的公司修改了,所以我不能问如何纠正这个问题。这是主题开发人员给我的代码,但它与主题附带的文件不对应。<?php echo \'<img src=\"\' . $src[0] . \'\" alt=\"\' . get_the_title() . \'\" />\'; ?> 我想我的问题是,我如何使这项工作,使我的alt标记显示出来。这是网站https://www.emabar

每当我添加新站点、添加用户等时,WordPress都会返回“您关注的链接已过期”错误页面 - 小码农CODE - 行之有效找到问题解决它

每当我添加新站点、添加用户等时,WordPress都会返回“您关注的链接已过期”错误页面

时间:2018-11-15 作者:user1234

我有一个Wordpress多站点(子域)实例运行在一个VPS上,它似乎按照预期工作,无论何时我添加一个用户或添加一个站点,都会返回“您关注的链接已过期”页面,并发生一些事情。

我使用Nginx和php7.2-fpm。

这里是配置文件:

server {
        listen 80;
        server_name www.domain.name domain.name *.domain.name;

        return 301 https://www.domain.name$request_uri;
}

server {
        listen 443 ssl;
        server_name domain.name;

        ssl_certificate /etc/letsencrypt/live/domain.name/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/domain.name/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

        return 301 https://www.domain.name$request_uri;
}

server {
        listen 443 ssl;
        server_name www.domain.name;

        root /var/www/wordpress;

    access_log /var/log/nginx/domain.name.access.log;
    error_log /var/log/nginx/domain.name.error.log;

        ssl_certificate /etc/letsencrypt/live/domain.name/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/domain.name/privkey.pem;
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    include global/common.conf;

    # WORDPRESS : Rewrite rules, sends everything through index.php and keeps the appended query string intact
    location / {
            try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    # SECURITY : Deny all attempts to access PHP Files in the uploads directory
    location ~* /(?:uploads|files)/.*\\.php$ {
            deny all;
    }
    # REQUIREMENTS : Enable PHP Support
    location ~ \\.php$ {
        # SECURITY : Zero day Exploit Protection
            try_files $uri =404;
            # ENABLE : Enable PHP, listen fpm sock
            fastcgi_split_path_info ^(.+\\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/php7.2-fpm-www.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }
    # PLUGINS : Enable Rewrite Rules for Yoast SEO SiteMap
    rewrite ^/sitemap_index\\.xml$ /index.php?sitemap=1 last;
    rewrite ^/([^/]+?)-sitemap([0-9]+)?\\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
}
全局/通用。形态:

# Global configuration file.
# ESSENTIAL : Configure Nginx Listening Port
listen 80;
# ESSENTIAL : Default file to serve. If the first file isn\'t found, 
index index.php index.html index.htm;
# ESSENTIAL : no favicon logs
location = /favicon.ico {
    log_not_found off;
    access_log off;
}
# ESSENTIAL : robots.txt
location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}
# ESSENTIAL : Configure 404 Pages
error_page 404 /404.html;
# ESSENTIAL : Configure 50x Pages
error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/www;
    }
# SECURITY : Deny all attempts to access hidden files .abcde
location ~ /\\. {
    deny all;
}
# PERFORMANCE : Set expires headers for static files and turn off logging.
location ~* ^.+\\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
    access_log off; log_not_found off; expires 30d;
}
我试图在网上找到解决方案,但什么都找不到。谢谢你的帮助!

1 个回复
SO网友:tradesouthwest

我也在寻找这个错误的答案。我能找到的最接近的是,它要么是插件中特定于插件的权限设置,要么是无效的nonce。请参见:Getting "The link you followed has expired" when adding custom post

相关推荐

无法在模板函数.php中使用IS_HOME

我试图在标题中加载一个滑块,但只在主页上加载。如果有帮助的话,我正在使用Ultralight模板。我正在尝试(在template functions.php中)执行以下操作:<?php if ( is_page( \'home\' ) ) : ?> dynamic_sidebar( \'Homepage Widget\' ); <?php endif; ?> 但这行不通。现在,通过快速的google,我似乎需要将请