Isso está acontecendo porque o local que, em última análise, acaba manipulando suas solicitações é location ~ \.php$
, que herda sua configuração de log do contexto do servidor. Assumindo que o yoast seo sitemap pertence ao app1, você vai querer uma configuração como esta:
# Use an upstream to future changes easier
upstream _php {
server unix:/var/run/php/php7.0-fpm.sock;
}
server {
listen 80 default;
listen [::]:80;
root /var/www/html/app1;
index index.php;
server_name localhost;
access_log /var/log/nginx/app1.access.log;
error_log /var/log/nginx/app1.error.log;
# Put php directives in the server context so they can be inherited by all locations
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
# Locations that aren't logged can be left outside and shared
location ~ /\.(?!well-known) {
deny all;
access_log off;
log_not_found off;
}
location ~* \.(woff|jpg|jpeg|png|gif|ico|css|js)$ {
access_log off;
log_not_found off;
expires 365d;
}
# Everything that logs to app1 should go in here
location / {
try_files $uri $uri/ /index.php?$is_args$args;
# SECURITY : Deny all attempts to access PHP Files in the uploads directory
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# PHP : pass the PHP scripts to FastCGI server defined in upstream _php
location ~ \.php$ {
fastcgi_pass _php;
}
# Yoast SEO Sitemaps
location ~ ([^/]*)sitemap-rewrite-disabled(.*).x(m|s)l$ {
## this redirects sitemap.xml to /sitemap_index.xml
rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
## this makes the XML sitemaps work
rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?xsl=$1 last;
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
## The following lines are optional for the premium extensions
## News SEO
rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
## Local SEO
rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
## Video SEO
rewrite ^/video-sitemap.xsl$ /index.php?xsl=video last;
}
}
# Everything that logs to app2 should go in here
location /app2 {
try_files $uri $uri/ /app2/index.php$is_args$args;
access_log /var/log/nginx/app2.access.log;
error_log /var/log/nginx/app2.error.log;
# SECURITY : Deny all attempts to access PHP Files in the uploads directory
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# PHP : pass the PHP scripts to FastCGI server defined in upstream _php
location ~ \.php$ {
fastcgi_pass _php;
}
}
}
Mover os parâmetros fastcgi para o servidor e usar um upstream para o servidor php significa que não é muito para duplicar.