您好,我有两个平台,其中一个作为子目录运行。我希望能够为每个应用程序提供访问和错误日志;但是它没有按我的意图工作:(
这是我所拥有的:
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;
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
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;
}
location / {
try_files $uri $uri/ /index.php?$is_args$args;
}
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; …Run Code Online (Sandbox Code Playgroud)