- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将 Nginx 与 Typo3 结合使用。我的 Typo3 安装有大约 8 个域。一切都像一个魅力。现在我遇到了一个问题,我想为每个域使用 AWStats,但我不知道如何为每个域分离访问日志。在下面你可以看到我的配置是如何实际运行的:
可用站点内的配置文件:
server {
listen 127.0.0.1:80;
server_name www.domain1.de
www.domain2.de
www.domain3.de
root "/var/www/oz/htdocs/";
disable_symlinks if_not_owner;
location ~ /\.ht {
deny all;
}
location ~ ^/cgi-bin/ {
deny all;
}
# PHP is enabled
index index.php index.html index.htm;
location ~ \.php(/|$) {
try_files $fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include /etc/nginx/fastcgi_params;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass unix:/var/www/oz/conf/sockets/nginx-php-fcgi.sock;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
}
location = / {
error_page 403 /.errorFiles/coming-soon.html;
}
location /.errorFiles/ {
alias /usr/share/liveconfig/html/;
}
#### NGINX Typo3 Config - Start #####
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
client_max_body_size 200M;
location ~ /\.(js|css)$ {
expires 604800s;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}
if (!-e $request_filename){
rewrite ^/(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ /$1.$3 last;
}
location ~* ^/fileadmin/(.*/)?_recycler_/ {
deny all;
}
location ~* ^/fileadmin/templates/.*(\.txt|\.ts)$ {
deny all;
}
location ~* ^/typo3conf/ext/[^/]+/Resources/Private/ {
deny all;
}
location ~* ^/(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) {
}
location / {
if ($query_string ~ ".+") {
return 405;
}
if ($http_cookie ~ 'nc_staticfilecache|be_typo_user|fe_typo_user' ) {
return 405;
} # pass POST requests to PHP
if ($request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
if ($http_pragma = 'no-cache') {
return 405;
}
if ($http_cache_control = 'no-cache') {
return 405;
}
error_page 405 = @nocache;
try_files /typo3temp/tx_ncstaticfilecache/$host${request_uri}index.html @nocache;
}
location @nocache {
try_files $uri $uri/ /index.php$is_args$args;
}
#### NGINX Typo3 Config - End #####
}
server {
listen 127.0.0.1:80;
server_name domain1.de;
rewrite ^/(.*)$ "http://www.domain1.de/$1" permanent;
}
server {
listen 127.0.0.1:80;
server_name domain2.de;
rewrite ^/(.*)$ "http://www.domain2.de/$1" permanent;
}
server {
listen 127.0.0.1:80;
server_name domain3.de;
rewrite ^/(.*)$ "http://www.domain3.de/$1" permanent;
}
nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 5000;
multi_accept on;
use epoll;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
# ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
我试图在服务器 block 中将它分开。但我不让它工作。这里有人可以帮助我或提供一些提示吗?
最佳答案
每个服务器
都可以覆盖它自己的访问日志位置:
server {
listen 127.0.0.1:80;
server_name domain1.de;
access_log /var/log/nginx/domain1-access.log;
error_log /var/log/nginx/domain1-error.log;
rewrite ^/(.*)$ "http://www.domain1.de/$1" permanent;
}
server {
listen 127.0.0.1:80;
server_name domain2.de;
access_log /var/log/nginx/domain2-access.log;
error_log /var/log/nginx/domain2-error.log;
rewrite ^/(.*)$ "http://www.domain2.de/$1" permanent;
}
server {
listen 127.0.0.1:80;
server_name domain3.de;
access_log /var/log/nginx/domain3-access.log;
error_log /var/log/nginx/domain3-error.log;
rewrite ^/(.*)$ "http://www.domain3.de/$1" permanent;
}
关于typo3-6.2.x - Nginx 为每个域单独的访问日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42377955/
考虑这两个程序及其尝试编译。 #include int main() { std::vector a; // Errors centered around `Typo` being an i
如何才能检测到拼写错误,但仅限于特定短语。另一种思考方式是如何检测某个正则表达式的拼写错误。 例如,我不想要一个通用的拼写错误查找器,我在上面找到了多个资源。我不想要一个通用的拼写检查器,我又在上面找
我现在正在研究算法,我遇到过一个例子,我的回答是 Infinite loop但在正确答案中,它说它是 O(log2n) . function someFunc(n) { for(var i =
IntelliJ IDEA 具有检查拼写的功能。在分析概述中,我可以看到发现了多少拼写错误,例如发现 12 个拼写错误。在代码中,它们使用绿色波浪线突出显示。 但是,我发现手动查找那些波浪线非常困难。
我是 still通过“七周内的七种语言”,我发现了一个错字或我不明白的东西。 挑战之一是: Write a function that takes an argument x and returns
我正在从 Jquery 调用 WCF Rest 服务,如下所示。在我的 WCF Rest 服务中,安全模式是传输。下面的代码返回“访问被拒绝”错误。 function GetRest
引用自 Resources Documentation 的 smallestWidth 部分安卓: Thus, the value you use should be the actual small
IntelliJ IDEA 具有检查拼写的检查功能。在分析概览中,我可以看到发现了多少拼写错误,例如发现 12 个拼写错误。在代码中,它们使用绿色波浪线突出显示。 但是,我发现手动查找那些波浪线非常困
当命名变量或提供字符串参数时,Android Studio 似乎对我如何标记事物有问题。 有没有办法关闭它? 最佳答案 是的,打开 Preferences -> Editor -> Inspectio
我已将数据添加到 solr。 名称字段值为:“batman”、“bat man”、“bat-man” 因此,如果用户搜索“btman”,结果应显示搜索中的所有上述值。 我发现这样的查询:localho
use YAML::XS; local $YAML::XS::DumpCode=1; ... 我收到警告: Name "YAML::XS::DumpCode" used only once: poss
我在 react native 应用程序中遇到了 eslint 的问题。我正在为我的组件声明样式属性。它看起来像: Component.propTypes = { styles: ViewPro
我的一个函数加密一个字符串,我的一个测试验证它发生了。自然,像 sldjf982389 这样的字符串不被识别为有效的英语单词,所以 IntelliJ提示。 如果有办法在不向字典中添加垃圾的情况下抑制这
我在云托管中托管了一个 wordpress 网站。我注意到 apache error_log 文件大小增长得非常快,我发现了这个错误(Kirki: Typo found in field post_t
我经常被指向错误博客引擎的来源,即 http://typosphere.org/stable.tar.gz但是,如果我下载并执行以下操作:捆绑安装等。它会作为单独的引擎运行。 我尝试将拼写错误安装为
我正在使用 cakePHP 创建待办事项应用程序。 CakePHP 会为您创建查询等。这就是为什么不能出现拼写错误的原因。 错误: Error: SQLSTATE[42S22]: Column not
我有一个脚本,它列出了特定目录中可能的文件。该代码工作正常,但如何避免此警告? #!/usr/bin/perl use strict; use warnings; use autodie; my $l
在Lua网站上https://www.lua.org/pil/16.1.html ,有这段代码 function Account:new (o) o = o or {} -- create o
在我的 Gruntfile.js 中,我将咖啡任务配置为如此,并且 src/ 目录中存在一个文件 script.coffee: coffee: { dist: { files:
我的问题是关于行(编辑:19),其中新的 PrintWriter 是使用将 FileWriter fw 作为参数的构造函数创建的。如果稍后在实际写作中不使用,我不明白将 BufferedWriter
我是一名优秀的程序员,十分优秀!