Translated using Weblate (Turkish)
[phpmyadmin.git] / test / nginx.conf
blobff78a46361bad3ef9616217c5b869e2435773ccc
1 worker_processes 4;
3 daemon on;
5 pid %DIR%/nginx.pid;
7 error_log %DIR%/nginx-error.log;
9 events {
10     worker_connections 1024;
13 http {
14     types {
15         text/html                             html htm shtml;
16         text/css                              css;
17         text/xml                              xml;
18         image/gif                             gif;
19         image/jpeg                            jpeg jpg;
20         application/javascript                js;
21         application/atom+xml                  atom;
22         application/rss+xml                   rss;
23     }
25     default_type application/octet-stream;
27     sendfile on;
28     tcp_nopush on;
29     tcp_nodelay on;
31     client_body_timeout 12;
32     client_header_timeout 12;
33     keepalive_timeout 15;
34     send_timeout 10;
35     server_tokens off;
37     client_body_buffer_size 512K;
38     client_body_temp_path %DIR%/client_body_temp;
39     client_header_buffer_size 16k;
40     client_max_body_size 512M;
41     large_client_header_buffers 4 8k;
43     gzip on;
44     gzip_comp_level 2;
45     gzip_min_length 1000;
46     gzip_proxied expired no-cache no-store private auth;
47     gzip_types text/plain application/x-javascript text/xml text/css application/xml;
49     access_log off;
51     server {
52         access_log %DIR%/nginx-access.log;
53         error_log %DIR%/nginx-error.log error;
54         listen 8000 default_server;
55         server_name _;
57         root %ROOT%;
59         index index.php index.html index.htm;
61         charset utf-8;
63         if ($request_method !~ ^(GET|HEAD|POST)$ ) {
64            return 405;
65         }
67         location / {
68             try_files $uri $uri/ =404;
69         }
71         location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
72             expires 365d;
73         }
75         location ~ \.php$ {
76             fastcgi_intercept_errors on;
77             fastcgi_pass unix:%DIR%/php-fpm.sock;
79             # regex to split $uri to $fastcgi_script_name and $fastcgi_path
80             fastcgi_split_path_info ^(.+\.php)(/.+)$;
82             # Check that the PHP script exists before passing it
83             try_files $fastcgi_script_name =404;
85             # Bypass the fact that try_files resets $fastcgi_path_info
86             # see: https://trac.nginx.org/nginx/ticket/321
87             set $path_info $fastcgi_path_info;
88             fastcgi_param PATH_INFO $path_info;
90             fastcgi_read_timeout 1200;
92             fastcgi_index index.php;
94             fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
95             fastcgi_param  QUERY_STRING       $query_string;
96             fastcgi_param  REQUEST_METHOD     $request_method;
97             fastcgi_param  CONTENT_TYPE       $content_type;
98             fastcgi_param  CONTENT_LENGTH     $content_length;
100             fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
101             fastcgi_param  REQUEST_URI        $request_uri;
102             fastcgi_param  DOCUMENT_URI       $document_uri;
103             fastcgi_param  DOCUMENT_ROOT      $document_root;
104             fastcgi_param  SERVER_PROTOCOL    $server_protocol;
105             fastcgi_param  REQUEST_SCHEME     $scheme;
106             fastcgi_param  HTTPS              $https if_not_empty;
108             fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
109             fastcgi_param  SERVER_SOFTWARE    nginx;
111             fastcgi_param  REMOTE_ADDR        $remote_addr;
112             fastcgi_param  REMOTE_PORT        $remote_port;
113             fastcgi_param  SERVER_ADDR        $server_addr;
114             fastcgi_param  SERVER_PORT        $server_port;
115             fastcgi_param  SERVER_NAME        $server_name;
117             # PHP only, required if PHP was built with --enable-force-cgi-redirect
118             fastcgi_param  REDIRECT_STATUS    200;
119         }
121         location ~ /\. {
122             deny  all;
123         }
125         location ~ /(libraries|templates) {
126             deny all;
127         }
129     }