文件:nginx.conf

内容:

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    client_max_body_size 32m;

include       mime.types;
    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 off;
    #access_log  logs/access.log  main;

sendfile        on;
    #tcp_nopush     on;

#keepalive_timeout  0;
    keepalive_timeout  65;

#gzip  on;

server {
        listen       80;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;
        
        root E:/www;

location / {
            #root   html;
            index  index.php index.html index.htm;
        }

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php {
        #    root           html;
            fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
            set $real_script_name $fastcgi_script_name;
            set $path_info "";
            if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$")
            {
                set $real_script_name $1;
                set $path_info $2;
            }
            fastcgi_param  SCRIPT_FILENAME  $document_root$real_script_name;
            include        fastcgi_params;
            fastcgi_param SCRIPT_NAME $real_script_name;
            fastcgi_param PATH_INFO $path_info;
        }

# deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

# another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

#    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

# HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

#    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

#    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

#    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

#    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

以上。

配置php环境的一个nginx.conf的更多相关文章

  1. [原]生产环境下的nginx.conf配置文件(多虚拟主机)

    [原]生产环境下的nginx.conf配置文件(多虚拟主机) 2013-12-27阅读110 评论0 我的生产环境下的nginx.conf配置文件,做了虚拟主机设置的,大家可以根据需求更改,下载即可在 ...

  2. 写一个nginx.conf方便用于下载某个网页的所有资源

    写一个nginx.conf方便用于下载某个网页的所有资源 worker_processes 1; events { worker_connections 1024; } http { include ...

  3. nginx环境下配置nagios-关于nagios配置文件nginx.conf

    接上文:nginx环境下配置nagios-关于nginx.conf 配置如下: ;          location ~ .*\.(php|php5)?$          {            ...

  4. 给大家推荐一个nginx.conf文件格式生成的网站

    特别好用: 根据选择自定义nginx.conf的配置: https://nginxconfig.io/?0.php=false&0.python&php_server=%2Fvar%2 ...

  5. 腾讯云服务器 - 配置JDK环境以及Tomcat+nginx服务器

    安装完ngxin以及fastdfs后,那么jdk和tomcat是肯定要装的,本篇很简单,实在没啥好说的,都是基础,略微带一下,如果是大牛路过可以看看吐槽一下 云服务器上初识环境如果没有选择附带其他软件 ...

  6. nginx.conf 完整的集群配置

    ###############################nginx.conf 整配置############################### #user nobody; # user 主模 ...

  7. nginx.conf 集群完整配置

    ###############################nginx.conf 集群完整配置############################### #user nobody; # user ...

  8. nginx的开机自启、server命令启动、nginx.conf配置

    1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/   ...

  9. Nginx 配置日志路径(nginx.conf没有写log路径,所以debug的时候找不到日志)

    缘由:nginx.conf没有写log路径,所以debug的时候找不到日志,遂在conf文件里写入了log路径 Setp1.nginx默认日志路径: /var/log/nginx Setp2.conf ...

随机推荐

  1. 作业二 | Git的安装与使用

    作业要求来自https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/2097 GitHub远程仓库的地址https://github.com/k ...

  2. SQL Server Report Server 报表用户权限T-SQL查询

    /************************************************************************** 查询用户在报表上的权限 ************ ...

  3. Beta(2/7)

    鐵鍋燉腯鱻 项目:小鱼记账 团队成员 项目燃尽图 冲刺情况描述 站立式会议照片 各成员情况 团队成员 学号 姓名 git地址 博客地址 031602240 许郁杨 (组长) https://githu ...

  4. Node.js c++ 扩展之HelloWorld

    测试环境 vs:vs2017 node.js:9.9.6 相关地址 官方文档对应地址:https://www.nodejs.org/api/addons.html 官方案例对应地址:https://w ...

  5. Node.js_express_搭建一个服务器

    原生 node 服务器 1. 导入 node.js 核心模块  / 自带模块 :   http const http = require('http'); // HTTP 库所具有的功能已经赋给了 h ...

  6. js 快速将字符串数组 转化为 数字数组(互换)

    转载于   这里 var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; arr.map(String); //结果: ['1', '2', '3', '4', '5', '6' ...

  7. linux 软链接和硬链接的区别 和 inode 的理解

    软连接和硬连接的区别:1.创建的方式不同软:ln -s 源文件 连接名硬:ln 源文件 连接名 2.原理不同,和删除源文件对其的影响.硬连接的inode节点和源文件的inode节点一样.也就是同一个i ...

  8. CGI的工作原理

    文章摘自https://blog.csdn.net/nyist327/article/details/41049699 CGI是Web服务器和外部程序之间的一个接口.利用CGI程序可以处理从Web上客 ...

  9. mysql查询两个日期之前相隔的天数

    select timestampdiff(SECOND,'2011-09-25 23:23:13','2011-09-26 22:23:11'); 其中SECOND同样可以改为HOUR,MINUTE

  10. Win10 将slim加入PYTHONPYTH

    1.LINUX 命令 export PYTHONPATH=$PYTHONPATH:'pwd':'pwd'/slim 2.Windows 命令 SET PYTHONPATH=%cd%;%cd%\slim ...