使用vvv-nginx-custom.conf
文件覆盖默认设置时,是否需要保持与默认相同的格式?它是否还需要包含默认值的所有内容?
我有点困惑,或者我误解了方向。
默认文件配置:
server {
listen 80;
listen 443 ssl http2;
server_name {vvv_hosts};
root {vvv_path_to_site}{vvv_public_dir};
# Nginx logs
error_log {vvv_path_to_site}/log/nginx-error.log;
access_log {vvv_path_to_site}/log/nginx-access.log;
# This is needed to set the PHP being used
set $upstream {upstream};
# Enable server push if SSL/HTTP2 is being used for link preload headers
http2_push_preload on;
{vvv_tls_cert}
{vvv_tls_key}
# Nginx rules for WordPress, rewrite rules, permalinks, etc
include /etc/nginx/nginx-wp-common.conf;
{{LIVE_URL}}
location ~* \.(css|eot|gif|ico|jpeg|jpg|js|png|svg|tiff|tiff|ttf|webp|woff|woff2)$ {
expires 100d;
}
}
这是否意味着定制的需要看起来像这样?
server {
listen 80;
listen 443 ssl http2;
server_name {vvv_hosts};
root {vvv_path_to_site}{vvv_public_dir};
# Nginx logs
error_log {vvv_path_to_site}/log/nginx-error.log;
access_log {vvv_path_to_site}/log/nginx-access.log;
# This is needed to set the PHP being used
set $upstream {upstream};
# Enable server push if SSL/HTTP2 is being used for link preload headers
http2_push_preload on;
{vvv_tls_cert}
{vvv_tls_key}
# Nginx rules for WordPress, rewrite rules, permalinks, etc
include /etc/nginx/nginx-wp-common.conf;
{{LIVE_URL}}
location ~* \.(css|eot|gif|ico|jpeg|jpg|js|png|svg|tiff|tiff|ttf|webp|woff|woff2)$ {
expires 100d;
}
# Custom rules
install_plugins: # Various way to install a plugin
- query-monitor
- classic-editor
- wordpress-seo
- all-in-one-wp-migration
- timber-library
wpconfig_constants:
WP_DEBUG: true
WP_DEBUG_LOG: true
WP_DISABLE_FATAL_ERROR_HANDLER: true # To disable in WP 5.2 the FER mode
}