nginx + php-fpm + magento
nginx + php-fpm + magento
hi,
ive installed vestacp with nginx + php fpm. When i moved an old magento (1.9) website to this new vestacp server erverything works fine, the website opens, but when i click on a menu i get 404 not found in url i see domain.com/index.php/submenutitle and as i see the issue is with index.php
do i need to fix something in nginx config? (i use default magento config)
thanks for the answer
ive installed vestacp with nginx + php fpm. When i moved an old magento (1.9) website to this new vestacp server erverything works fine, the website opens, but when i click on a menu i get 404 not found in url i see domain.com/index.php/submenutitle and as i see the issue is with index.php
do i need to fix something in nginx config? (i use default magento config)
thanks for the answer
Re: nginx + php-fpm + magento
There is no magento Web Template? Do you have one? I did a fresh install and don't see one?
Re: nginx + php-fpm + magento
No i dont have magento template... and i think there is an issue in configuration, does maybe staff know know to do it?
Re: nginx + php-fpm + magento
Magento needs a custom nginx configuration file just like WordPress does. What web template are you using? Perhaps "wordpress2" may work for you?kaines wrote:No i dont have magento template... and i think there is an issue in configuration, does maybe staff know know to do it?
Re: nginx + php-fpm + magento
strnage is, if i choose other template it doesnt take it, and when i try the configuration file with nginx -t i get:
nginx: [emerg] "location" directive is not allowed here in /home/USERNAME/conf/web/nginx.conf:48
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] "location" directive is not allowed here in /home/USERNAME/conf/web/nginx.conf:48
nginx: configuration file /etc/nginx/nginx.conf test failed
Re: nginx + php-fpm + magento
Without known what's in the file /home/USERNAME/conf/web/nginx.conf it's hard to help you.kaines wrote:strnage is, if i choose other template it doesnt take it, and when i try the configuration file with nginx -t i get:
nginx: [emerg] "location" directive is not allowed here in /home/USERNAME/conf/web/nginx.conf:48
nginx: configuration file /etc/nginx/nginx.conf test failed
It may be duplicate lines? nginx has nothing to do with Magento, etc so if nginx fails here it's a config error.
Re: nginx + php-fpm + magento
i have rebuilded the whole user and now templates work ok, but magento with index.php still doesnt work, ive tryed all templates.
Re: nginx + php-fpm + magento
Paste the contents of nginx.confkaines wrote:i have rebuilded the whole user and now templates work ok, but magento with index.php still doesnt work, ive tryed all templates.
Re: nginx + php-fpm + magento
This is the template for wordpress
server {
listen IP:8082;
server_name user.mydomain.com http://www.user.mydomain.com;
root /home/myusername/web/user.mydomain.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/user.mydomain.com.log combined;
access_log /var/log/nginx/domains/user.mydomain.com.bytes bytes;
error_log /var/log/nginx/domains/user.mydomain.com.error.log error;
location / {
rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
rewrite "^/rules.html$" /index.php?do=rules last;
rewrite "^/statistics.html$" /index.php?do=stats last;
rewrite "^/addnews.html$" /index.php?do=addnews last;
rewrite "^/rss.xml$" /engine/rss.php last;
rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
if (!-d $request_filename) {
rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
}
if (!-f $request_filename) {
rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
}
if (!-f $request_filename) {
rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9004;
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/myusername/web/user.mydomain.com/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include /home/myusername/conf/web/nginx.user.mydomain.com.conf*;
}
Last edited by kaines on Tue Aug 09, 2016 7:57 am, edited 1 time in total.
Re: nginx + php-fpm + magento
lol.
That's not a standard nginx configuraton file - that's heavily customised. Do you even know what half of that stuff is?
That's not a standard nginx configuraton file - that's heavily customised. Do you even know what half of that stuff is?