Opencart Nginx Rewrite Space(%20) and Latin Characters Issue

Viewed 24

I am running Opencart on Nginx. But I'm having trouble using some of the spaces or latin characters while searching the site. How can I use spaces and some latin characters (ooo...) with rewrite? So far, I haven't been able to solve the problem with my research on the internet. Please help me. I am grateful to you.

Here is my Vhost code; (Cloudpanel)

server {
  listen 80;
  listen [::]:80;
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  server_name example.com;
  return 301 https://www.example.com$request_uri;
}

server {
  listen 80;
  listen [::]:80;
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  server_name www.example.com;
  {{root}}
  {{nginx_access_log}}
  {{nginx_error_log}}

  rewrite ^/sitemap.xml$ /index.php?route=extension/feed/sitemap last;
  location / {
    try_files $uri @example.com;
  }
  location @example.com  {
    rewrite ^/(.+)$ /index.php?_route_=$1 last;
  }
  location /admin {
    index index.php;
  }
  location /system/ {
    return 404;
    deny all;
  }
  location ~ /system/(.+)\.(js|css)$ {
    allow all;
  }
  location /system/storage/session/ {
    return 404;
    deny all;
  }
  location ~* \.(engine|inc|info|ini|install|log|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
    return 404;
    deny all;
    }
  location = /favicon.ico {
    log_not_found off;
    access_log    off;
  }
  location = /robots.txt {
    log_not_found off;
    access_log    off;
  }
  location = /apple-touch-icon.png {
    log_not_found off;
    access_log off;
  }
  location = /apple-touch-icon-precomposed.png {
    log_not_found off;
    access_log off;
  }
  location ~ ~$ {
    access_log off;
    log_not_found off;
    deny all;
  }
  location ~* /(?:cache|logs|image|download)/.*\.php$ {
    return 404;
    deny all;
  }
  location ~* \.(eot|otf|ttf|woff)$ {
    add_header Access-Control-Allow-Origin *;
  }
  location ~ /\.ht {
    deny all;
  }
  location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess|config.php) {
    return 404;
    deny all;
  }
  location ~* /(catalog|ie_pro|image|system)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ {
    return 404;
    deny all;
  }

  location ~ /.well-known {
    auth_basic off;
    allow all;
  }

  {{settings}}

  try_files $uri $uri/ /index.php?$args;
  index index.php index.html;

  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_intercept_errors on;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files $uri =404;
    fastcgi_read_timeout 3600;
    fastcgi_send_timeout 3600;
    fastcgi_param HTTPS $fastcgi_https;
    fastcgi_pass 127.0.0.1:{{php_fpm_port}};
    fastcgi_param PHP_VALUE "{{php_settings}}";
  }

  location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
    add_header Access-Control-Allow-Origin "*";
    expires max;
    access_log off;
  }

  if (-f $request_filename) {
    break;
  }
}
0 Answers
Related