zabbix-docker/Dockerfiles/web-nginx-pgsql/centos/conf/etc/zabbix/nginx.conf

91 lines
2.3 KiB
Nginx Configuration File
Raw Normal View History

2016-08-03 10:09:49 +02:00
server {
2021-06-07 15:44:31 +02:00
listen 8080;
listen [::]:8080;
2016-08-03 10:09:49 +02:00
server_name zabbix;
index {HTTP_INDEX_FILE};
2016-08-03 10:09:49 +02:00
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log notice;
2016-08-03 10:09:49 +02:00
set $webroot '/usr/share/zabbix';
root $webroot;
large_client_header_buffers 8 8k;
client_max_body_size 10M;
location = /favicon.ico {
log_not_found 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;
}
# caching of files
2021-06-07 19:52:40 +02:00
location ~* \.ico$ {
2016-08-03 10:09:49 +02:00
expires 1y;
}
2021-06-07 19:52:40 +02:00
location ~* \.(js|css|png|jpg|jpeg|gif|xml|txt)$ {
2016-08-03 10:09:49 +02:00
expires 14d;
}
location ~ /(app\/|conf[^\.]|include\/|local\/|locale\/|vendor\/) {
2021-06-07 19:52:40 +02:00
deny all;
return 404;
}
location ~ ^/(status|ping)$ {
access_log off;
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
include fastcgi_params;
}
2016-08-03 10:09:49 +02:00
location / {
try_files $uri $uri/ =404;
2016-08-03 10:09:49 +02:00
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
set $path_info $fastcgi_path_info;
try_files $fastcgi_script_name =404;
2020-04-25 19:31:44 +02:00
fastcgi_pass unix:/tmp/php-fpm.sock;
fastcgi_index {HTTP_INDEX_FILE};
2016-08-03 10:09:49 +02:00
fastcgi_param DOCUMENT_ROOT $webroot;
2016-08-03 10:09:49 +02:00
fastcgi_param SCRIPT_FILENAME $webroot$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $webroot$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
2016-08-03 10:09:49 +02:00
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
2016-08-03 10:09:49 +02:00
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
2020-10-14 14:49:48 +02:00
fastcgi_read_timeout {FCGI_READ_TIMEOUT};
2016-08-03 10:09:49 +02:00
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}