nginx-(/usr/local/nginx/conf/nginx.conf)更改配置文件

user www www;

worker_processes 2;

error_log /usr/local/nginx/logs/error.log info ;
pid /var/run/nginx.pid;
worker_rlimit_nofile 65535;

events
{
use epoll;
worker_connections 65535;
}

http
{
    include mime.types;
    default_type application/octet-stream;
    #charset utf-8;
    server_names_hash_bucket_size 128;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 64k;
    client_max_body_size 8m;
    sendfile on;
    autoindex on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 120;
    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 128k;

    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types text/plain application/x-JavaScript text/css application/xml;
    gzip_vary on;

    server
    {

       listen 80;
       server_name localhost
       index index.html index.htm index.PHP;
       root /usr/local/nginx/html;

       location ~ \.php$
       {
             fastcgi_pass unix:/tmp/php-fcgi.sock;
        fastcgi_index index.php;
        include fastcgi.conf;
       }
    }
}
时间: 2024-11-05 17:15:12

nginx-(/usr/local/nginx/conf/nginx.conf)更改配置文件的相关文章

nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx/nginx.pid”

在Mac上用brew安装Nginx,然后修改Nginx配置文件,再重启时报出如下错误: nginx: [error] invalid PID number "" in "/usr/local/var/run/nginx/nginx.pid" 解决办法: $ sudo nginx -c /usr/local/etc/nginx/nginx.conf $ sudo nginx -s reload

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 2017年09月14日 09:15:45 阅读数:7742 启动Nginx出现这个错误 nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 1  解决方法:找

PHP 5.6启动失败failed to open configuration file '/usr/local/php/etc/php-fpm.conf'

PHP编译安装完毕,启动失败,提示 1 [23-Jun-2014 12:27:02] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2) 2 [23-Jun-2014 12:27:02] ERROR: failed to load configuration file '/usr/local/php/etc/php-fpm.conf' 3

nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:37

一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 1 nginx: [emerg] the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:37 原因也很简单,nginx缺少http_ssl_module模块,编译安装的时候带上--with-http_ssl_module配置就行了,但是现在的情况是我的nginx已经安装过了,

nginx: the "ssl" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf

Nginx如果未开启SSL模块,配置Https时将提示如题错误 原因:nginx缺少http_ssl_module模块,编译安装的时候带上--with-http_ssl_module配置就行了,但是现在的情况是我的nginx已经安装过了,怎么添加模块(我的nginx的安装目录是/usr/local/nginx这个目录,我的源码包在/home/nginx-1.16.1目录) 1.切换到源码包:cd /home/nginx-1.16.1 执行:./configure --prefix=/usr/lo

01_Nginx安装,nginx下部署项目,nginx.conf配置文件修改,相关文件配置

?? 1.下载Nginx,进入Nginx下载地址:http://nginx.org/ 点击nginx-1.8.0,进入:http://nginx.org/en/download.html,下载文件: 2 下载pcre,这个是一个正则表达式的库,Nginx做rewriter的时候回用到这个库: 进入pcre的官网(rewrite模式需要pcre):http://www.pcre.org/ 选中右击复制所需要的版本: 3 下载zlib库(gzip模块需要zlib):http://www.zlib.n

解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid

重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件 [[email protected] sbin]# ./nginx -s reload nginx: [err

Nginx(三):nginx.conf配置文件说明 【2】 文件结构和配置高亮

配置文件结构说明: 里面的配置文件有几个,当然最主要是nginx.conf配置文件. Main配置段,是核心配置段. Events { 配置事件的 } Http { } 标准http配置段,可选http配置段,都在http{}这里配置,每一种都是一个独立的. 注意:每一个配置参数都需要以分号结尾 标准模块也叫作核心模块是默认都安装的,如果不想安装就是-without什么,可选模块是默认不安装的,如果想安装就是-with-什么 可选模块比如-with-http_ssl_module和-with-h

解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed错误

重新启动服务器,访问web服务发现无法浏览啦!登陆服务器之后进到nginx使用./nginx -s reload重新读取配置文件,发现报nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)错误,进到logs文件发现的确没有nginx.pid文件 [[email protected] sbin]# ./nginx -s reload nginx: [err

nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)

问题场景 服务器重启后,重启nginx时报错nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory),进入到logs目录发现确实没有nginx.pid文件 解决办法 使用指定nginx.conf文件的方式重启nginx /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf还有一种可能就