80 lines
2.2 KiB
Nginx Configuration File
80 lines
2.2 KiB
Nginx Configuration File
user www-data;
|
|
|
|
worker_processes auto;
|
|
pcre_jit on;
|
|
error_log /dev/stderr warn;
|
|
include /etc/nginx/modules/*.conf;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
server_tokens off;
|
|
client_max_body_size 10m;
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
gzip_vary on;
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
log_format traceable '[$time_iso8601] status: $status - origin: "$upstream_http_x_wh_backend" - text: "$upstream_http_x_status" - apikey: "$http_x_apikey" '
|
|
'- event: "$upstream_http_x_wh_event" - type: "$upstream_http_x_wh_type" - id: "$request_id" '
|
|
'- item: "$upstream_http_x_wh_item" - record_id: "$upstream_http_x_wh_id" '
|
|
'- request: "$request":$body_bytes_sent - ip: $remote_addr - host: $http_host - agent: "$http_user_agent"';
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
error_log /dev/stderr warn;
|
|
access_log /dev/stdout traceable;
|
|
|
|
root /app/public;
|
|
|
|
index index.html index.php;
|
|
|
|
charset utf-8;
|
|
|
|
location = /favicon.ico {
|
|
access_log off;
|
|
log_not_found off;
|
|
return 204;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?$query_string;
|
|
}
|
|
|
|
location ~* (index|test)\.php$ {
|
|
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
|
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
|
|
# Check that the PHP script exists before passing it
|
|
try_files $fastcgi_script_name =404;
|
|
|
|
# Bypass the fact that try_files resets $fastcgi_path_info
|
|
# see: http://trac.nginx.org/nginx/ticket/321
|
|
set $path_info $fastcgi_path_info;
|
|
fastcgi_param PATH_INFO $path_info;
|
|
|
|
# For better request traking.
|
|
fastcgi_param X_REQUEST_ID $request_id;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
include fastcgi.conf;
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
}
|
|
|
|
location ~ /\.ht {
|
|
deny all;
|
|
}
|
|
}
|
|
}
|