NooBAsTiK Posted February 5, 2022 Report Share Posted February 5, 2022 Добрый день всем! Подскажите пожалуйста как правильно настроить nginx что бы работали ссылки ЧПУ. Как только включаю ЧПУ в настройках форума, всегда выдаётся только первая страница и всё. Настройки nginx сейчас такие: location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:run/php/php7.4-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } Как я понимаю нужно править try_files, только вопрос как правильно? Quote Link to comment Share on other sites More sharing options...
CoronaGR Posted February 5, 2022 Report Share Posted February 5, 2022 In my setup I use the below rules: # IPS REWRITE RULES location / { try_files $uri $uri/ /index.php?$args; } # IPS API location /api/ { try_files $uri $uri/ /api/index.php?$args; } # IPS PHP/CGI PROTECTION location ~ ^/uploads/.*\.(?:php\d*|phtml)$ { deny all; } location ~ ^/datastore/.*\.(?:php\d*|phtml)$ { deny all; } Quote Link to comment Share on other sites More sharing options...
NooBAsTiK Posted February 5, 2022 Author Report Share Posted February 5, 2022 17 минут назад, CoronaGR сказал: In my setup I use the below rules: Doesn't work for me Quote Link to comment Share on other sites More sharing options...
CoronaGR Posted February 5, 2022 Report Share Posted February 5, 2022 Did you restart the nginx after the changes? Quote Link to comment Share on other sites More sharing options...
NooBAsTiK Posted February 5, 2022 Author Report Share Posted February 5, 2022 3 минуты назад, CoronaGR сказал: Did you restart the nginx after the changes? Yes, and php7.4-fpm restart. Quote Link to comment Share on other sites More sharing options...
Desti Posted February 5, 2022 Report Share Posted February 5, 2022 (edited) del Edited February 5, 2022 by Desti Quote Link to comment Share on other sites More sharing options...
Desti Posted February 5, 2022 Report Share Posted February 5, 2022 location / { root /home/user/dir; index index.php; try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php.sock; fastcgi_temp_file_write_size 10m; fastcgi_busy_buffers_size 512k; fastcgi_buffer_size 512k; fastcgi_buffers 16 512k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/user/dir$fastcgi_script_name; } Вот мой работающий код от тестового сервера, furl работает нормально Quote Link to comment Share on other sites More sharing options...
NooBAsTiK Posted February 5, 2022 Author Report Share Posted February 5, 2022 Спасибо, попробую Не заработало... Может чего с php-fpm? Quote Link to comment Share on other sites More sharing options...
NooBAsTiK Posted February 12, 2022 Author Report Share Posted February 12, 2022 Перепробовал всё что нашел, но так и не заработало. Очень странно что при включении FURLs всегда выдаётся первая страница форума, но при этом в адресной строке написаны разные FURLs если щелкать по темам форума Quote Link to comment Share on other sites More sharing options...
Zero108 Posted January 13 Report Share Posted January 13 Ну, и смысл тогда запускать php-fpm, если надо мучаться с настройках nginx? ISP Manager из коробки настраивает php как модуль апач, и не надо мучаться. Зачем тогда говорить о каком-то преимуществе php-fpm?! Quote Link to comment Share on other sites More sharing options...
Desti Posted January 13 Report Share Posted January 13 1 час назад, Zero108 сказал: Зачем тогда говорить о каком-то преимуществе php-fpm?! Когда у вас на сайте "1 пользователь онлайн" очень легко рассуждать о преимуществах режимов работы http сервера. Quote Link to comment Share on other sites More sharing options...
Zero108 Posted January 13 Report Share Posted January 13 (edited) А никто не измерял нагрузку. Все разное пишут. Хотелось бы увидеть пруфы сравнения в виде скриншотов по нагрузке. "Где пруфы, Билли? Нам нужны пруфы!" Edited January 13 by Zero108 SlawkA 1 Quote Link to comment Share on other sites More sharing options...
Donjuan Posted January 13 Report Share Posted January 13 (edited) 14 минут назад, Zero108 сказал: А никто не измерял нагрузку У меня php-fpm до 60 % бывает скочет) причем как я только не менял настройки сервера и nginx .. но все работает при этом и не лагает.. хрен знает его, мб еще и от железа зависит Хитачес кстати в свое время херачил до 80-90% Edited January 13 by Donjuan Quote Link to comment Share on other sites More sharing options...
Desti Posted January 13 Report Share Posted January 13 45 минут назад, Donjuan сказал: Хитачес Я даже представить не могу, как файл настроек апача может "херачить до 80-90%" Quote Link to comment Share on other sites More sharing options...
Donjuan Posted January 13 Report Share Posted January 13 32 минуты назад, Desti сказал: Я даже представить не могу, как файл настроек апача может "херачить до 80-90%" Вот и никто не мог, равно как и исправить это. Я уже на это плюнул давно. Работает php-fpm+nginx и хорошо SlawkA 1 Quote Link to comment Share on other sites More sharing options...
SlawkA Posted January 13 Report Share Posted January 13 (edited) Zero108 дарю))) Где карта- Билли.mp4 Где карта- Билли.mp4 Edited January 13 by SlawkA Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.