Page 1 of 1

OpenCart 3.x SEO URL NGINX & Bitnami 404 Error

Posted: Mon Jun 08, 2020 2:19 pm
by omx89
Hello,

I have installed OpenCart on Nginx using Bitnami and my opencart files are located in this path /opt/bitnami/apps/opencart/htdocs and my Nginx path is /opt/bitnami/nginx

This is my nginx-prefix.conf file below and I have tried every solution online I can find but I cannot make the SEO URL work the links work fine if I turn off the SEO URL from the admin panel.

Filename: nginx-prefix.conf

Code: Select all

location /opencart {
    index  index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
    alias "/opt/bitnami/apps/opencart/htdocs";
    include "/opt/bitnami/apps/opencart/conf/nginx-app.conf";
}
location / {
  index  index.php index.html index.htm;
  if (!-e $request_filename){
    rewrite ^/([^?]*) /index.php?_route_=$1 break;
  }
  if ($request_filename ~* ^.*?/([^/]*?)$)
        {
          set $filename $1; 
        }

  if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
    add_header Access-Control-Allow-Origin *;
  }
  alias "/opt/bitnami/apps/opencart/htdocs/";
  include "/opt/bitnami/apps/opencart/conf/nginx-app.conf";
}

autoindex off;

location ~ .*\.(ico|gif|jpg|jpeg|png|js|css) {
}

location /system {
  rewrite ^/system/storage/(.*) /index.php?route=error/not_found break;
}

location = /sitemap.xml {
  rewrite ^(.*)$ /index.php?route=extension/feed/google_sitemap break;
}

location = /googlebase.xml {
  rewrite ^(.*)$ /index.php?route=extension/feed/google_base break;
}

Re: OpenCart 3.x SEO URL NGINX & Bitnami 404 Error

Posted: Mon Jun 08, 2020 4:48 pm
by letxobnav
I am not knowledgable on nginx but maybe this has some clues:
https://serverfault.com/questions/85099 ... with-nginx