zqcolor
- zqcolor 回答了问题 yii2 urlManager 配置无效啊
下面我测试工作的, centos7+php5.6w+nginx1.63
yii2 advanced 的版本xxx.xxx.xxx 换成你的域名
主要是"location /" 里面的东西rewrite rules重要server { listen 80 default_server; #listen [::]:80 default_server; server_name xxx.xxx.xxx; root /usr/share/nginx/html/yii-application/frontend/web/; index index.php index.html index.htm; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { # Redirect everything that isn't a real file to index.php #try_files $uri $uri/ /index.php?$is_args$args; try_files $uri $uri/ /index.php?$args; #rewrite rules #autoindex on ; if (!-e $request_filename){ rewrite ^/(.*) /index.php?r=$1 last; } } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # With php5-fpm: fastcgi_pass unix:/run/php-fpm/php5-fpm.sock; fastcgi_index index.php; include fastcgi.conf; } location /phpMyAdmin { alias /usr/share/nginx/html/phpMyAdmin; index index.php index.html index.htm; } location ~ /phpMyAdmin/.*\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$uri; include fastcgi_params; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }
- zqcolor 评论了源码 xiaoego.com网站源码
zhjyang
zhjyang 评论于 2016-03-02 13:41举报来点个赞,准备学习下
- zqcolor 评论了源码 xiaoego.com网站源码
zhjyang
zhjyang 评论于 2016-03-02 13:41举报来点个赞,准备学习下