nginx默认配置
来源:互联网 发布:坚持跑步 知乎 编辑:程序博客网 时间:2024/06/16 19:14
server {
listen 80;
server_name _;
access_log /usr/local/nginx/access_nginx.log combined;
root /var/www/html/default;
index index.html index.htm index.php;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location ~ \.php {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
#nginx配置支持php的pathinfo模式配置方法
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
}
include vhost/*.conf;
}
listen 80;
server_name _;
access_log /usr/local/nginx/access_nginx.log combined;
root /var/www/html/default;
index index.html index.htm index.php;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1;
}
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location ~ \.php {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
#nginx配置支持php的pathinfo模式配置方法
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
}
include vhost/*.conf;
}
0 0
- nginx默认配置
- nginx默认配置
- nginx配置默认首页
- nginx 的默认配置语法
- nginx配置:---此处选择默认
- nginx配置改变默认访问路径
- 配置静态站点,修改Nginx默认根目录
- nginx多域名配置及默认页面
- 配置Apache 和 配置Nginx 的默认站点
- nginx默认nginx.conf
- Nginx 安装/配置/启动/关闭-默认安装到/usr/local/nginx/
- nginx 更改配置client_max_body_size没有生效 nginx.conf 修改默认限制上传附件大小
- nginx设置默认目录
- nginx(11) nginx 配置动静分离,设置默认主页,限制某个路径的资源代理全解
- nginx、php-fpm默认配置与性能–TCP socket还是unix domain socket
- nginx、php-fpm默认配置与性能–TCP socket还是unix domain socket
- nginx、php-fpm默认配置与性能–TCP socket还是unix domain socket
- Varnish+Nginx 配置----Nginx
- iOS 之 UITableView 使用详解/性能优化/UITableViewCell/UITableViewController
- Android中Menu的基本用法
- 如何加速百度搜索引擎的收录 小熊办公小编为您支上几招
- Android 4.0 Launcher源码分析系列(一)
- <OJ_Sicily>Hanoi_Tower_Sequence
- nginx默认配置
- 一个namenode能正常启动,状态为active,另一个namenode无法启动
- MyCat - 源代码篇(10)
- uva11383
- linux运维必备技能
- HDU 2002 计算球体积(水题)
- Linux查看端口使用状态、关闭端口方法
- NSAttributedString那点事
- C#虚函数