Nginx配置文件参数
来源:互联网 发布:人工智能湖南论坛 编辑:程序博客网 时间:2024/06/16 17:22
#设定虚拟主机配置 server { #侦听80端口 listen 80; #定义使用 www.nginx.cn访问 server_name www.nginx.cn; #定义服务器的默认网站根目录位置 root html; #设定本虚拟主机的访问日志 access_log logs/nginx.access.log main; #默认请求 location / { #定义首页索引文件的名称 index index.php index.html index.htm; } # 定义错误提示页面 error_page 500 502 503 504 /50x.html; location = /50x.html { } #静态文件,nginx自己处理 location ~ ^/(images|javascript|js|css|flash|media|static)/ { #过期30天,静态文件不怎么更新,过期可以设大一点, #如果频繁更新,则可以设置得小一点。 expires 30d; } #PHP 脚本请求全部转发到 FastCGI处理. 使用FastCGI默认配置. location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } #禁止访问 .htxxx 文件 location ~ /.ht { deny all; } }
简易配置 server {
listen 80; server_name www.siye.so; index index.html index.htm index.php; root /home/wwwroot/postlog/public;location ~ .*\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name;include fastcgi_params; }# 根据laravel规则进行url重写if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?/$1 last; break; }}
阅读全文
0 0
- nginx 配置文件参数说明
- nginx配置文件参数详解
- nginx配置文件参数详解
- nginx配置文件参数详解
- Nginx配置文件参数
- Nginx主配置文件参数详解
- nginx配置文件nginx.conf参数说明
- Nginx配置文件优化实例与参数详解
- Nginx配置文件配置参数的意思
- nginx配置文件各参数详解 &nb…
- nginx发送html文件,加了配置文件参数读取
- nginx 配置文件参数说明,SSL加密配置样例
- nginx配置文件
- nginx配置文件
- Nginx配置文件
- nginx 配置文件
- nginx配置文件
- nginx配置文件
- 反转链表java实现
- 个人存档用2
- 模拟面试-线程向
- 合并单元格
- python3 怎么把竖行输出转为横行输出 (加入逗号的改变)
- Nginx配置文件参数
- pat 乙级 1037. 在霍格沃茨找零钱(20)
- Curl
- 线性回归之代价函数除2m
- log4j实战
- C语言--链表与CMap
- 线性代数的本质(Essense Of Linear Algebra)[1]
- HDU 1260 Tickets
- shell 脚本echo和printf学习