[nginx]nginx配置文件如何配置
[nginx]nginx配置文件如何配置
[nginx]nginx配置文件如何配置
- server {
- listen 80;
- server_name 你的域名;
- root 根目录;
- index index.php index.html;
- # location ~ ^/$ {
- # return 400;
- # }
- if (!-e $request_filename) {
- rewrite ^/(.*) /index.php/$1 last;
- }
- location ~* \.php {
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- # fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- location ~ /\.git { deny all; }
- }
热门文章推荐
- [nginx]使用nginx搭建rtmp流媒体服务器环境
- [nginx]HTTP服务器Nginx.conf配置文件介绍与调试
- [Nginx]windows下设置Nginx随机子开机自动启动运行的方法
- [nginx]NGINX的rtmp流媒体插件
- [nginx]Nginx下限速限制下载速度实例
- [nginx]nginx-rtmp-module使用实现rtmp
- [nginx]做防盗链的教程:Apache和Nginx防盗链的几种配置方法
- [nginx]Windows环境的Nginx启动与重启操作
请稍候...