2016-10-07 6 views
0

nginxサーバーにyii2をデプロイしていて、うまくいきました。/ admin URLでadminセクションにアクセスできますが、/ adminの下にある他のURLは使用できません。私はアプリケーションでかなりのURLを有効にしている、何がnginxの設定を変更する必要がありますYii2 nginxで管理していないpretty URL管理

答えて

0

あなたのnginxのconfを追加することはできますか?

私も同じ問題に直面しましたが、このconfを使用していますか?

server { 
charset utf-8; 
client_max_body_size 128M; 

listen 80; ## listen for ipv4 
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6 

server_name mysite.local; 
root  /path/to/basic/web; 
index  index.php; 

access_log /path/to/basic/log/access.log; 
error_log /path/to/basic/log/error.log; 

location/{ 
    # Redirect everything that isn't a real file to index.php 
    try_files $uri $uri/ /index.php$is_args$args; 
} 

# uncomment to avoid processing of calls to non-existing static files by Yii 
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { 
# try_files $uri =404; 
#} 
#error_page 404 /404.html; 

# deny accessing php files for the /assets directory 
location ~ ^/assets/.*\.php$ { 
    deny all; 
} 

location ~ \.php$ { 
    include fastcgi_params; 
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
    fastcgi_pass 127.0.0.1:9000; 
    #fastcgi_pass unix:/var/run/php5-fpm.sock; 
    try_files $uri =404; 
} 

location ~* /\. { 
    deny all; 
} 

}

more at here

+0

はい、私は同じのconfを持っています –

関連する問題