File: //etc/nginx/conf.d/default.tmpl
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
# O valor máximo para o parâmetro worker_processes é definido em 10.
# Caso seja definido um valor maior, esse valor será substituído automaticamente por 10
worker_processes 1;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
events {
# O valor máximo para worker_connections é igual ao total de memória de seu planoe (em MB)
# Caso seja definido um valor maior, ele será substituido automaticamente
worker_connections 128;
multi_accept on;
use epoll;
}
http {
include /var/www/html/nginx-conf/mime.types;
include /var/local/nginx/http/*.conf;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
index index.html index.htm;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /var/www/html/nginx-conf/conf.d/*.conf;
server {
listen 80 default_server;
#server_name localhost;
root /usr/share/nginx/html;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
# Load configuration files for the default server block.
include /var/www/html/nginx-conf/default.d/*.conf;
location / {
root /var/www/html/${http_x_realhost}/web;
try_files $uri $uri/ /index.php?$args;
index index.htm index.html index.html.var index.shtml index.php index.php5 index.php4 index.php3 noindex.html;
}
# redirect server error pages to the static page /40x.html
#
error_page 404 /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
# set header X-App-Status
add_header X-App-Status "1" always;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ [^/]\.php(/|$) {
root /var/www/html/${http_x_realhost}/web;
rewrite ^/index.php/(.*) /$1;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
include /var/local/nginx/php/*.conf;
# override fastcgi_params
fastcgi_param REMOTE_ADDR $http_x_real_ip;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_ADMIN webmaster@localhost;
fastcgi_param SCRIPT_URI http://$http_host$fastcgi_script_name;
fastcgi_param SCRIPT_URL $fastcgi_script_name;
fastcgi_param SERVER_NAME $http_host;
fastcgi_param SERVER_SIGNATURE "";
}
}
}