站長資訊網(wǎng)
        最全最豐富的資訊網(wǎng)站

        nginx不支持yii怎么辦

        nginx不支持yii怎么辦

        nginx不支持yii怎么辦?nginx部署yii2的方法

        只需要修改nginx.config配置文件內(nèi)容,在里面增加server,并且root寫成index.php文件在的目錄下就可以

        還要設(shè)置config/web.php里的cookieValidationKey值,以及一些目錄的訪問權(quán)限需要設(shè)置成777

        nginx配置文件內(nèi)容

        #user  nobody; worker_processes  1; #error_log  logs/error.log; #error_log  logs/error.log  notice; #error_log  logs/error.log  info; #pid        logs/nginx.pid; events {     worker_connections  1024; } http {     include       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  0;     keepalive_timeout  65;     #gzip  on;     server {         listen       80;         server_name  localhost;         #charset koi8-r;         #access_log  logs/host.access.log  main;         location / {             root   html;             index  index.php index.html index.htm;         }         #error_page  404              /404.html;         # redirect server error pages to the static page /50x.html         #         error_page   500 502 503 504  /50x.html;         location = /50x.html {             root   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$ {             root           html;             fastcgi_pass   127.0.0.1:9000;             fastcgi_index  index.php;         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;         #    include        fastcgi_params;             include         fastcgi.conf;         }         # deny access to .htaccess files, if Apache's document root         # concurs with nginx's one         #         #location ~ /.ht {         #    deny  all;         #}     }     # 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;     #    }     #}     #yi正mjh graduation project config     server {         charset utf-8;         client_max_body_size 128M;                     listen 8080;         server_name www.mjh.com;         root    /var/www/mjhGraduation/web;         index   index.php;         access_log      /var/www/mjhGraduation/access.log main;         error_log       /var/www/mjhGraduation/error.log;         location /{                  # Redirect everything that isn't a real file to index.php                 try_files $uri $uri/ /index.php?args;         }         location ~ .php$ {                 include fastcgi.conf;                 fastcgi_pass 127.0.0.1:9000;                 try_files $uri = 404;         }         error_page 404 /404.html;         location ~ /.(ht|svn|git){                 deny all;         }     }     #gsh graduation project config     server {         charset utf-8;         client_max_body_size 128M;                     listen 8088;         server_name www.mjh.com;         root    /var/www/gshGraduation/web;         index   index.php;         access_log      /var/www/gshGraduation/access.log main;         error_log       /var/www/gshGraduation/error.log;         location /{                  # Redirect everything that isn't a real file to index.php                 try_files $uri $uri/ /index.php?args;         }         location ~ .php$ {                 include fastcgi.conf;                 fastcgi_pass 127.0.0.1:9000;                 try_files $uri = 404;         }         error_page 404 /404.html;         location ~ /.(ht|svn|git){                 deny all;         }     }     # HTTPS server     #     #server {     #    listen       443 ssl;     #    server_name  localhost;     #    ssl_certificate      cert.pem;     #    ssl_certificate_key  cert.key;     #    ssl_session_cache    shared:SSL:1m;     #    ssl_session_timeout  5m;     #    ssl_ciphers  HIGH:!aNULL:!MD5;     #    ssl_prefer_server_ciphers  on;     #    location / {     #        root   html;     #        index  index.html index.htm;     #    }     #} }

        相關(guān)文章教程推薦:yii教程

        贊(0)
        分享到: 更多 (0)
        網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號
        主站蜘蛛池模板: 欧美午夜精品一区二区三区91 | 人妻少妇精品无码专区动漫| 久久免费的精品国产V∧| 欧美亚洲另类精品第一页| 99久久国产综合精品麻豆| 国产原创精品视频| 91精品一区国产高清在线| 思思久久99热免费精品6| 亚洲精品无码国产| 一本一本久久A久久综合精品| 精品亚洲麻豆1区2区3区| 国产精品亚洲午夜一区二区三区| 2021年精品国产福利在线| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 国产精品岛国久久久久| 无码精品国产VA在线观看| 国内少妇偷人精品视频免费| 国产女主播精品大秀系列| 欧美日韩国产精品| 国产精品欧美一区二区三区| 麻豆精品久久久一区二区| 精品国产一区二区三区在线观看| 欧美激情精品久久久久久久九九九 | 精品精品国产国产| 中文无码久久精品| 精品无码一级毛片免费视频观看| 永久免费精品视频| 久久青青草原精品国产不卡| 亚洲AV永久无码精品网站在线观看| 精品水蜜桃久久久久久久| 99热都是精品久久久久久| 中日韩产精品1卡二卡三卡| 国产精品多人p群无码| 精品视频一区二区三区| 国产精品一区在线观看你懂的| 四虎影视永久在线观看精品| 尤物国精品午夜福利视频| 亚洲精品老司机在线观看| 高清在线亚洲精品国产二区| 国产精品日本一区二区不卡视频| 久久精品天天中文字幕人妻|