We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Конвертация .htaccess на nginx
Конвертация .htaccess на nginx
Доброго всем времени суток. У меня сервер Nginx + PHP7-FPM. На нем три рабочих сайта. Приобрел скрипт одного сайта и не могу его запустить.
Предполагаю что не правильно перевел htaccess
Родной htaccess
Логи ошибок сайта
Предполагаю что не правильно перевел htaccess
Родной htaccess
То что я перевелCode: Select all
AddDefaultCharset utf-8 Options +FollowSymLinks Options All -Indexes DirectoryIndex index.php ErrorDocument 404 /404/ RewriteEngine On # Бан "плохих" ботов для снижения нагрузки на сервер RewriteCond %{HTTP_USER_AGENT} (AhrefsBot|MJ12bot|DotBot|BUbiNG\ Crawler|BUbiNG|FaceBook\ Crawler|FaceBook|SemrushBot|LinkdexBot|Alexa\ Robot|Alexa|Ads.txt-crawler|Powermarks|GrapeshotCrawler|grapeshot|SimplePie|360Spider|CCBot|SeznamBot|LinkpadBot|BLEXBot) [NC] RewriteRule .* - [R=403,L] # Обратная совместимость со старыми страницами RewriteRule ^pages/(.*)$ /page/$1 [L,R=301] # Редирект с WWW RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L] RedirectMatch 403 ^/cache/ # API админ панели RewriteRule ^admin/api/(.*) /adminko/?act=api&api=$1 [NS,L]
Должна открываться админка по ссылке https://musicat.net/adminko/?login=mseadmin123Code: Select all
server { listen 185.244.217.184:443; server_name musicat.net www.musicat.net; root /home/admin/web/musicat.net/public_html; index index.php index.html index.htm; access_log /var/log/nginx/domains/musicat.net.log combined; access_log /var/log/nginx/domains/musicat.net.bytes bytes; error_log /var/log/nginx/domains/musicat.net.error.log error; ssl on; ssl_certificate /home/admin/conf/web/ssl.musicat.net.pem; ssl_certificate_key /home/admin/conf/web/ssl.musicat.net.key; location / { location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { expires max; } location /admin { try_files $uri /admin/index.php?$query_string; } location ~* "\/sys_tmp|^/ucontent|^/system\/|\/stats_tmp\/|\/_rezerv_images\/|\/cache\/|\.ini|(user)?macros\.xml$|\.lock|\.db|\/parsing_log\.txt|\/antivirus_md5\.txt|\.cfg|_client\.zip|\/browscap_cache\.php|\/templates\/.*\.(html|tpl|php|txt)|public\/view\/stats\/cloaking.js" { deny all; return 404; } location ~ [^/]\.php(/|$) { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_param PHP_ADMIN_VALUE "realpath_turbo.open_basedir=/home/admin/web/musicat.net/public_html/"; fastcgi_pass unix:/var/run/php-musicat.net.sock; fastcgi_index index.php; include /etc/nginx/fastcgi_params; } } error_page 403 /error/404.html; error_page 404 /error/404.html; error_page 500 502 503 504 /error/50x.html; location /error/ { alias /home/admin/web/musicat.net/document_errors/; } location ~* "/\.(htaccess|htpasswd)$" { deny all; return 404; } location /vstats/ { alias /home/admin/web/musicat.net/stats/; include /home/admin/conf/web/musicat.net.auth*; } include /etc/nginx/conf.d/phpmyadmin.inc*; include /etc/nginx/conf.d/phppgadmin.inc*; include /etc/nginx/conf.d/webmail.inc*; include /home/admin/conf/web/snginx.musicat.net.conf*; ############################################################### htaccess начало ############################################################### # Редирект с index.php/html на сайт #location /index.html { #rewrite / / permanent; #} #if ($request_uri ~* "^(.*/)index\.php$") { # return 301 $1; #} # Редирект со страниц /pages/1/ на главную #rewrite ^/pages/1$ https://musicat.net; if ($http_host ~* "^www.(.*)$"){ set $rule_2 1$rule_2; set $bref_1 $1; } if ($rule_2 = "1"){ rewrite ^/(.*)$ http://$bref_1/$1 permanent; } if (!-f $request_filename){ set $rule_3 1$rule_3; } if (!-d $request_filename){ set $rule_3 2$rule_3; } if ($rule_3 = "21"){ rewrite /.* /index.php last; } rewrite ^/pages/(.*)$ /page/$1 permanent; rewrite ^/admin/api/(.*) /adminko/?act=api&api=$1 last; rewrite ^/sitemap.xml$ /sitemap.xml last; #Блокируем всяких ботов if ($http_user_agent ~ SputnikBot|Crowsnest|PaperLiBot|peerindex|ia_archiver|Slurp|Aport|NING|JS-Kit|rogerbot|BLEXBot|MJ12bot|Twiceler|Baiduspider|Java|CommentReader|Yeti|discobot|BTWebClient|Tagoobot|Ezooms|igdeSpyder|AhrefsBot|Teleport|Offline|DISCo|netvampire|Copier|HTTrack|WebCopier|omgili|socialmediascanner|Jooblebot|SeznamBot|Scrapy|CCBot|linkfluence|veoozbot|Leikibot|Seopult|Faraday|hybrid|Go-http-client|SMUrlExpander|SNAPSHOT|getintent|ltx71|Nuzzel|SMTBot|Laserlikebot|facebookexternalhit|mfibot|OptimizationCrawler|crazy|Dispatch|ubermetrics|HTMLParser|musobot|filterdb|InfoSeek|omgilibot|DomainSigma|SafeSearch|CommentReader|meanpathbot|statdom|proximic|spredbot|StatOnlineRuBot|openstat|DeuSu|semantic|postano|masscan|Embedly|NewShareCounts|linkdexbot|GrapeshotCrawler|Digincore|NetSeer|help.jp|PaperLiBot|getprismatic|360Spider|Ahrefs|ApacheBench|Aport|Applebot|archive|BaiduBot|Baiduspider|Birubot|BLEXBot|bsalsa|Butterfly|Buzzbot|BuzzSumo|CamontSpider|curl|dataminr|discobot|DomainTools|DotBot|Exabot|Ezooms|FairShare|FeedFetcher|FlaxCrawler|FlightDeckReportsBot|FlipboardProxy|FyberSpider|Gigabot|gold\ crawler|HTTrack|ia_archiver|InternetSeer|Jakarta|Java|JS-Kit|km.ru|kmSearchBot|Kraken|larbin|libwww|Lightspeedsystems|Linguee|LinkBot|LinkExchanger|LinkpadBot|LivelapBot|LoadImpactPageAnalyzer|lwp-trivial|majestic|Mediatoolkitbot|MegaIndex|MetaURI|MJ12bot|MLBot|NerdByNature|NING|NjuiceBot|Nutch|OpenHoseBot|Panopta|pflab|PHP/|pirst|PostRank|ptd-crawler|Purebot|PycURL|Python|QuerySeekerSpider|rogerbot|Ruby|SearchBot|SemrushBot|SISTRIX|SiteBot|Slurp|Sogou|solomono|Soup|spbot|suggybot|Superfeedr|SurveyBot|SWeb|trendictionbot|TSearcher|ttCrawler|TurnitinBot|TweetmemeBot|UnwindFetchor|urllib|uTorrent|Voyager|WBSearchBot|Wget|WordPress|woriobot|Yeti|YottosBot|Zeus|zitebot|ZmEu) { return 403; } ############################################################### htaccess конец ######################################################## }
Логи ошибок сайта
Может сможет ктото помочь. Спасибо.Code: Select all
Stack trace: #0 /home/admin/web/musicat.net/public_html/cache/aac63ff250655b3c041716ed0c5b36466842b25e_0.file.sidebar.tpl.php(31): smarty_function_getGenres(Array, Object(Smarty_Internal_Template)) #1 /home/admin/web/musicat.net/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(128): content_5cb09601469fc6_32405253(Object(Smarty_Internal_Template)) #2 /home/admin/web/musicat.net/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(172): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #3 /home/admin/web/musicat.net/public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(206): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template)) #4 /home/admin/web/musicat.net/public_html/v" while reading response header from upstream, client: 66.249.79.26, server: musicat.net, request: "GET /artist/luck+muzik HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-musicat.net.sock:", host: "musicat.net"
Re: Конвертация .htaccess на nginx
Здравствуйте. Какие шаблоны используются в настройках веб-домена? Возможно для вашей цмс нужны специальные nginx правила. Скорее всего не правильно перевели, htaccess не будет работать на веб-стеке с php-fpm
Re: Конвертация .htaccess на nginx
На всех сайтах стоит
Шаблон Web:default
Шаблон Backend:socket
Шаблон Web:default
Шаблон Backend:socket
Re: Конвертация .htaccess на nginx
Мне больше нравится этот http://www.anilcetin.com/convert-apache ... -to-nginx/
Пробовал без результатно
Пробовал без результатно
Re: Конвертация .htaccess на nginx
Вопрос решен, спасибо