Source

iredmail / iRedMail / conf / nginx

Full commit
#!/usr/bin/env bash

# Author: Zhang Huangbin (zhb _at_ iredmail.org)

#---------------------------------------------------------------------
# This file is part of iRedMail, which is an open source mail server
# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
#
# iRedMail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iRedMail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------

export NGINX_RC_SCRIPT_NAME='nginx'
export PHP_FPM_RC_SCRIPT_NAME='php-fpm'
export UWSGI_RC_SCRIPT_NAME='uwsgi'

# Configuration files
export NGINX_CONF_ROOT='/etc/nginx'
export NGINX_CONF="${NGINX_CONF_ROOT}/nginx.conf"
export NGINX_CONF_DIR="${NGINX_CONF_ROOT}/conf.d"
export NGINX_CONF_DEFAULT="${NGINX_CONF_DIR}/default.conf"

# Log files
export NGINX_LOG_ACCESSLOG='/var/log/nginx/access.log'
export NGINX_LOG_ERRORLOG='/var/log/nginx/error.log'

# PID file
export NGINX_PID='/var/run/nginx.pid'

export NGINX_MIME_TYPES="${NGINX_CONF_ROOT}/mime.types"

# php-fpm
export FASTCGI_PASS='unix:/var/run/php5-fpm.sock'
export NGINX_PHP_INI="${APACHE_PHP_INI}"

if [ X"${DISTRO}" == X'DEBIAN' -o X"${DISTRO}" == X'UBUNTU' ]; then
    export NGINX_PHP_INI='/etc/php5/fpm/php.ini'

elif [ X"${DISTRO}" == X"FREEBSD" ]; then
    export NGINX_CONF_ROOT="/usr/local/etc/nginx"
    export NGINX_CONF="${NGINX_CONF_ROOT}/nginx.conf"
    export NGINX_CONF_DIR="${NGINX_CONF_ROOT}/Includes"

    # Log file location.
    export NGINX_LOG_ACCESSLOG='/var/log/nginx-access.log'
    export NGINX_LOG_ERRORLOG='/var/log/nginx-error.log'
fi