default_url_PHP_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > PHP > default_url

default_url

 2019/11/11 17:50:22  coollyj  程序员俱乐部  我要评论(0)
  • 摘要:server{listen80default_server;server_name_;root/home/web;#charsetkoi8-r;#access_loglogs/host.access.logmain;location/{indexindex.htmlindex.php;#文件目录不存在时重写地址if(!-e$request_filename){rewrite^/(.*)$/index.php/$1last;}}error_page404/404.html
  • 标签:Default URL
server {
    listen       80 default_server;
    server_name  _;

    root   /home/web;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        index  index.html index.php;
#文件目录不存在时重写地址
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
}
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/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 {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
    location ~ .*\.(css|js|swf|php|htm|html)$ {
add_header Cache-Control no-store;
}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}
上一篇: 有趣的事 下一篇: 没有下一篇了!
发表评论
用户名: 匿名