我在我的服务器上使用 Nginx 和 php-fpm 来运行我的 Wordpress 博客。
当有人在 Facebook 上分享我的网站时,Facebook 添加了一些参数,URL 如下所示:
我检查了我的日志,发现这个请求有一个“414 Request-URI Too Long”。我尝试在我的 Nginx 配置文件中添加 large_client_header_buffers 但没有结果。
但是,如果您只使用普通 URL ( https://jp.rlauzier.com/2013/07/les-courriels-et-la-securite-quelques-notions-a-savoir/ ),则一切正常。
这是我的配置文件:
server {
listen 443;
server_name jp.rlauzier.com;
ssl on;
ssl_certificate /etc/nginx/ssl/jp.rlauzier.com.crt;
ssl_certificate_key /etc/nginx/ssl/jp.rlauzier.com.key;
include /var/www/jp.rlauzier.com/public_html/nginx.conf;
location / {
root /var/www/jp.rlauzier.com/public_html/;
index index.php index.html index.htm;
if ($request_uri ~* \.(ico|css|js|gif|jpe?g|png)$) {
expires max;
break;
}
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /var/www/jp.rlauzier.com/public_html/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /(\.|wp-config.php|nginx.conf|readme.html|license.txt) {
return 404;
}
}
server {
listen 80;
server_name jp.rlauzier.com rlauzier.com;
rewrite ^ https://jp.rlauzier.com$request_uri? permanent;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4666 次 |
最近记录: |