Nginx用根目录中的Rewrite规则后,无法启动

Nginx用根目录中的Rewrite规则后,无法启动

By cbcslz at 2017-08-31
0人收藏 • 2882人看过

因个人需要,选择安卓套件ksweb。


遇到的问题,选择NGINX(不能用lighttpd)后,加入Rewrite规则就无法启动NGINX了。


不加的话,注册用户最后一步就是"Error: 404 NOT FOUND"


原始NGINX的conf:

#user  nobody;

worker_processes  4;


error_log  /mnt/sdcard/ksweb/log/nginx/errors.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;


#pid        logs/nginx.pid;



events {

    worker_connections  1024;

}


# nginx configuration




http {

    include       /data/data/ru.kslabs.ksweb/components/nginx/conf/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  logs/access.log  main;


    sendfile        on;

    #tcp_nopush     on;


    keepalive_timeout  65;


    gzip  on;


client_max_body_size 20M;

#begin_hosts (do not remove this label!)

include /data/data/ru.kslabs.ksweb/components/nginx/conf/localhost_host.conf;

include /data/data/ru.kslabs.ksweb/components/nginx/conf/localhost_8508c818-8824-43f0-9370-8241fb58158b_host.conf;

include /data/data/ru.kslabs.ksweb/components/nginx/conf/localhost_fda0f74b-45d9-4faa-b4c5-8322c3ebe166_host.conf;

#end_hosts (do not remove this label!)


    # 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;

    #    server_name  localhost;


    #    ssl                  on;

    #    ssl_certificate      cert.pem;

    #    ssl_certificate_key  cert.key;


    #    ssl_session_timeout  5m;


    #    ssl_protocols  SSLv2 SSLv3 TLSv1;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;

    #    ssl_prefer_server_ciphers   on;


    #    location / {

    #        root   html;

    #        index  index.html index.htm;

    #    }

    #}


}


版本信息:

php:5.6.12



登 录


现在注册

QQ  登 录    Weibo  登 录    GitHub  登 录