nginx 重启失败:[emerg] 指令“pagespeed”未以“;”结尾,位于 /etc/nginx/vhosts.d/name.d/pagespeed.conf:14 nginx

nginx 重启失败:[emerg] 指令“pagespeed”未以“;”结尾,位于 /etc/nginx/vhosts.d/name.d/pagespeed.conf:14 nginx

尝试重新启动 nginx 以获取此信息:

[emerg] directive "pagespeed" is not terminated by ";" in /etc/nginx/vhosts.d/appname.d/pagespeed.conf:14
nginx.

pagespeed.conf:

pagespeed Domain domain.com
pagespeed Domain www.domain.com
pagespeed Domain d3r58zp8b5siia.cloudfront.net
pagespeed MapRewriteDomain d3r58zp8b5siia.cloudfront.net domain.com
# pagespeed Domain http://example.com;
# pagespeed Domain http://cdn.example.com;

#pagespeed MapRewriteDomain d1v88ngz0mzdwa.cloudfront.net cdn.example.com;

pagespeed EnableFilters add_head, combine_css, combine_javascript, convert_meta_tags, extend_cache, fallback_rewrite_css_urls, flatten_css_imports, inline_css, inline_import_to_link, inline_javascript, rewrite_css, rewrite_images, rewrite_javascript, rewrite_style_attributes_with_url

# Ensure requests for pagespeed optimized resources go to the pagespeed
# handler and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
location /ngx_pagespeed_statistics { deny all; }
location /ngx_pagespeed_global_statistics { deny all; }
location /ngx_pagespeed_message { deny all; }
location /pagespeed_console { deny all; }

答案1

所有 pagespeed 配置条目末尾都需要有 ';'。

相关内容