站長資訊網
        最全最豐富的資訊網站

        nginx不支持yii怎么辦

        nginx不支持yii怎么辦

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

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

        還要設置config/web.php里的cookieValidationKey值,以及一些目錄的訪問權限需要設置成777

        nginx配置文件內容

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

        相關文章教程推薦:yii教程

        贊(0)
        分享到: 更多 (0)
        網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號
        主站蜘蛛池模板: 国产精品无码久久综合网| 亚洲国产一成久久精品国产成人综合| 国产精品久久久久久久午夜片 | 一本色道久久88综合日韩精品| 四虎国产精品永久地址51| 亚洲精品高清无码视频| 国产原创精品 正在播放| 久久精品免费观看| 国产成人精品高清在线观看93 | 欧美日韩国产精品自在自线| 日韩精品在线视频| 国产精品vⅰdeoxxxx国产| 中文字幕在线亚洲精品| 久久久久国产精品麻豆AR影院 | 国产成人无码精品久久久免费| 国产精品视频二区不卡| 亚洲国产一成人久久精品| 亚洲AV无码成人精品区狼人影院 | 亚洲AV永久无码精品| 亚洲精品456播放| 亚洲第一区精品观看| 久久久久亚洲精品男人的天堂| 国产精品99久久久久久猫咪 | 久久精品国产亚洲av日韩| 亚洲国产一成人久久精品| 尤物TV国产精品看片在线| 一本一本久久A久久综合精品| 亚洲精品乱码久久久久久蜜桃 | 久久夜色精品国产噜噜噜亚洲AV| 一本久久精品一区二区| 亚洲国产精品VA在线观看麻豆| 亚洲日韩精品射精日| 无码人妻精品一区二区三区东京热 | 国产99视频精品免费视频76| 日韩麻豆国产精品欧美| 91久久精品国产成人久久| 国产精品国产三级国产av品爱网 | 隔壁老王国产在线精品| 国产精品成人一区二区| 国内精品伊人久久久久影院对白 | 91国内外精品自在线播放|