On the site created on yii2 , only the main page of the site opens, on the internal pages an error is 404. The site works in the Nginx + PHP-FPM mode. In this case, to solve this problem, I tried to add the rules for the site to the Nginx server configuration file.
In /etc/nginx/vhosts/user/example.com.conf, I added the following rules:
#user 'user' virtual host 'example.com' configuration file server { server_name example.com mail.example.com pop.example.com smtp.example.com www.example.com; charset UTF-8; disable_symlinks if_not_owner from=$root_path; index index.php; root $root_path; set $root_path /var/www/user/data/www/example.com/public_html; access_log /var/www/httpd-logs/example.com.access.log ; error_log /var/www/httpd-logs/example.com.error.log notice; listen *.*.*.*:80 default_server; include /etc/nginx/vhosts-includes/*.conf; location / { location ~ [^/]\.ph(p\d*|tml)$ { try_files /does_not_exists @php; } } location @php { fastcgi_index index.php; fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f ****@******.com"; fastcgi_pass unix:/var/www/php-fpm/user.sock; fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$; try_files $uri =404; include fastcgi_params; } location @fallback { } ssi on; return 301 https://$host:443$request_uri; } server { server_name example.com mail.example.com pop.example.com smtp.example.com www.example.com; charset UTF-8; disable_symlinks if_not_owner from=$root_path; index index.php; root $root_path; set $root_path /var/www/user/data/www/example.com/public_html; access_log /var/www/httpd-logs/example.com.access.log ; error_log /var/www/httpd-logs/example.com.error.log notice; include /etc/nginx/vhosts-includes/*.conf; location / { location ~ [^/]\.ph(p\d*|tml)$ { try_files /does_not_exists @php; } } location @php { fastcgi_index index.php; fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f *****@*******.com"; fastcgi_pass unix:/var/www/php-fpm/user.sock; fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$; try_files $uri =404; include fastcgi_params; } location @fallback { } ssi on; listen *.*.*.*:443 default_server; ssl on; ssl_certificate "/var/www/httpd-cert/user/example.com_le4.crtca"; ssl_certificate_key "/var/www/httpd-cert/user/example.com_le4.key"; ssl_ciphers *************************************; ssl_dhparam /etc/ssl/certs/dhparam4096.pem; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; } Here are the urlManager settings:
'urlManager' => [ 'class' => 'app\components\LangUrlManager', 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => true, 'rules' => [ //'<lang:(ru|en)>/<controller:[\w-]+>/<action:[\w-]+>' => '<controller>/<action>', //'<lang:(ru|en)>/<controller:[\w-]+>' => '<controller>', // system '/' => 'default', 'captcha/get' => 'default/captcha', 'admin' => 'admin/default', 'admin/<controller:[\w-]+>' => 'admin/<controller>', 'admin/<controller:[\w-]+>/<action:[\w-]+>' => 'admin/<controller>/<action>', // user 'newuser' => 'user/signup', 'enter' => 'user/signin', 'logout' => 'user/signout/index', 'rescue' => 'user/reminder', 'room' => 'user/profile/index', 'settings' => 'user/setting/index', 'friends' => 'user/friend/index', 'messages' => 'user/message/index', 'messages/view/<username:[\w-]+>' => 'user/message/view', 'page/<username:[\w-]+>' => 'user/page/index', // pages 'info/<name:(about|rules|contacts|manual|levels)>' => 'page', // news 'news' => 'news', 'news/like' => 'news/like', // payment 'payin' => 'payment/index', 'payin/<system:\w+>/view' => 'payment/view', 'payin/<system:\w+>/status' => 'payment/status', 'payin/<system:\w+>/success' => 'payment/success', 'payin/<system:\w+>/failed' => 'payment/failed', // payout 'payout' => 'payout/index', 'payout/system/<system:\w+>' => 'payout/system', 'payout/view-all' => 'payout/viewall', // operations 'history' => 'user/operation/index', // referals 'partner' => 'user/referal/index', 'banner' => 'user/referal/banner', 'partner/view' => 'user/referal/view', 'in/<inviterUsername:[\w-]+>' => 'invite/index', // game 'game/shop' => 'game/shop/index', 'game/market' => 'game/market/index', 'game/bonus' => 'game/bonus/index', 'game/new-year' => 'game/new-year/index', 'game/tree' => 'game/tree/index', 'game/tree/view/<id:\w+>' => 'game/tree/view', 'square' => 'square/index', 'feedback' => 'feedback/index', 'notice' => 'user/notice/index', 'notice/gen' => 'user/notice/gen', 'confirm' => 'user/confirm/index', 'banners/create' => 'banner/create', 'links/create' => 'link/create', 'game/stock' => 'game/stock/index', 'game/stock-market' => 'game/stock-market/index' ], ], I faced nginx first time. Asked to adjust the site. But I can not understand what else can be added there. Can someone help?