配置php环境的一个nginx.conf
文件: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的更多相关文章
- [原]生产环境下的nginx.conf配置文件(多虚拟主机)
[原]生产环境下的nginx.conf配置文件(多虚拟主机) 2013-12-27阅读110 评论0 我的生产环境下的nginx.conf配置文件,做了虚拟主机设置的,大家可以根据需求更改,下载即可在 ...
- 写一个nginx.conf方便用于下载某个网页的所有资源
写一个nginx.conf方便用于下载某个网页的所有资源 worker_processes 1; events { worker_connections 1024; } http { include ...
- nginx环境下配置nagios-关于nagios配置文件nginx.conf
接上文:nginx环境下配置nagios-关于nginx.conf 配置如下: ; location ~ .*\.(php|php5)?$ { ...
- 给大家推荐一个nginx.conf文件格式生成的网站
特别好用: 根据选择自定义nginx.conf的配置: https://nginxconfig.io/?0.php=false&0.python&php_server=%2Fvar%2 ...
- 腾讯云服务器 - 配置JDK环境以及Tomcat+nginx服务器
安装完ngxin以及fastdfs后,那么jdk和tomcat是肯定要装的,本篇很简单,实在没啥好说的,都是基础,略微带一下,如果是大牛路过可以看看吐槽一下 云服务器上初识环境如果没有选择附带其他软件 ...
- nginx.conf 完整的集群配置
###############################nginx.conf 整配置############################### #user nobody; # user 主模 ...
- nginx.conf 集群完整配置
###############################nginx.conf 集群完整配置############################### #user nobody; # user ...
- nginx的开机自启、server命令启动、nginx.conf配置
1.将Nginx设置为开机自动启动 a.当上面6步完成之后,说明安装已经完全成功了,但是每次开机我们面临的一个问题,就是每次都要执行命令(1: cd /usr/local/nginx/sbin/ ...
- Nginx 配置日志路径(nginx.conf没有写log路径,所以debug的时候找不到日志)
缘由:nginx.conf没有写log路径,所以debug的时候找不到日志,遂在conf文件里写入了log路径 Setp1.nginx默认日志路径: /var/log/nginx Setp2.conf ...
随机推荐
- AMPPZ-2015 (MIPT Workshop Open 1)
A. Album of Numbers 设$cnt[i]$表示数字$i$的个数,则$ans=\frac{\sum_{i} i\times cnt[i]\prod_{j>i}(cnt[j]+1)} ...
- 20181115 python-第一章学习小结part1
知识点回顾: 什么是编程: 写代码,让计算机执行任务 编程语言的分类与特性: 1.机器语言,即二进制语言,最帖近于机器底层,可以由计算机直接执行,故速度最快,但不适合开发. 2.汇编语言,直接将二进制 ...
- TypeScript系列 - 什么是TypeScript
看了很多关于TypeScript的文章,总体说来没有很好的,一个系统的学习TypeScript的资源. 接下来,我将给大家带来TypeScript的系列,让你和我一样,一步一步的学习TypeScrip ...
- js获取手机信息
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- [LeetCode] All Paths From Source to Target 从起点到目标点到所有路径
Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and re ...
- Ubuntu 安装 Redis和phpredis扩展
服务器Ubuntu16.04 环境php7.0+Apache /****************************开始安装Redis****************************/ 1 ...
- 弄懂JDK、JRE和JVM到底是什么
首先是JDK JDK(Java Development Kit) 是 Java 语言的软件开发工具包(SDK).在JDK的安装目录下有一个jre目录,里面有两个文件夹bin和lib,在这里可以认为bi ...
- input 在 2 和 3 上的区别
2 和 3 上面 在 input 的区别 1 2 3 name = raw_input('请输入用户名:')#python2.7的用法 name = input('请输入用户名:')#python3 ...
- WebSocket(一)-RFC6455
1.官方在线 本地下载 参考翻译:gitbook
- 你应当如何学习C++以及编程(细节是必要的,但不是重要的,把时间用在集中精力去解决问题,而不是学习新技术,那样练不成高手。在实践中提高才是最重要的。最最重要的内功还是长期学习所磨练出来的自学能力)good
最近在学习Qt但由于没有C++的基础,感觉学的很吃力.看到pongba的这篇文章感觉不错就弄过来了, 原文地址:http://blog.csdn.net/qter_wd007/article/deta ...