Please tell me how to register the nginx virtual server config for opencart, if it is located in the subdirectory of an existing site?

Those. there is a configured virtual server domain.ru Opencart should be available at domain.ru/store/ What should I write in server_name?

On www.domain.ru/store; nginx swears.

server name "www.domain.ru/store" has suspicious symbols in /etc/nginx/sites-enabled/virtual.host:9

  • You are obviously not trying to do something. no directories are allowed in the server_name directive. what exactly is not working for you? Please indicate this directly in the question. - aleksandr barakin pm
  • The existing site on joomla 3.5 in the subdirectory is opencart when trying to enable the seo url, it redirects to the page with error 500 The table '/ tmp / # sql_934_2' is full Tried to ask about this problem (ibtmp1 file overflowed all free disk space) here forums.mysql.com/read.php?22,644191,644191#msg-644191 But the problem was not solved. - Magi
  • I do not know what a “seo url” is, but it’s probably what you need to deal with. I can assume that this is some kind of “extension” for the engine, and for its operation, url manipulations are required, which (according to good old tradition) are oriented to apache (and the .htaccess file). the nginx program has nothing to do with .htaccess, of course. - aleksandr barakin
  • The option "Enable SEO URL" in the opencart settings - human-readable links. Yes, and there is. Htaccess for Apache. Therefore, I ask how to configure correctly under nginx. - Magi
  • it's a completely different question. select the necessary “seo url” rules in the apache “language” and “translate” them into the configuration for nginx. - aleksandr barakin

1 answer 1

I did this to myself:

  rewrite /store/vqmod/install$ $scheme://$host$uri/ permanent; location /store/vqmod/install/ { index index.php; } location = /store/sitemap.xml { rewrite ^(.*)$ /index.php?route=feed/google_sitemap break; } location = /store/googlebase.xml { rewrite ^(.*)$ /index.php?route=feed/google_base break; } location /store/ { try_files $uri $uri/ @opencart; } location @opencart { rewrite ^/(.+)$ /index.php?_route_=$1 last; } location ~* \.(engine|inc|info|ini|install|log|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ { deny all; } location ~* \.(?:3gp|gif|jpg|jpe?g|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|woff)$ { expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } location ~ ~$ { access_log off; log_not_found off; deny all; } location ~* /(?:cache|logs|image|download)/.*\.php$ { deny all; } location ~* \.(eot|otf|ttf|woff)$ { add_header Access-Control-Allow-Origin *; } 

CNC SeoPro works without problems