1

Below is nginx.conf

server {
listen  00.00.000.000:80;

server_name my_site.com www.my_site.com;

return 301 https://www.my_site.com$request_uri;
}

server {
listen  00.00.000.000:443;

server_name my_site.com www.my_site.com;

error_log  /var/log/httpd/domains/my_site.com.error.log error;

ssl on;
ssl_certificate   cert/214816718480217.pem;
ssl_certificate_key  cert/214816718480217.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

location / {

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_pass      http://00.00.000.000:8080;
    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
        root           /home/my_site/web/my_site.com/public_html;
        access_log     /var/log/httpd/domains/my_site.com.log combined;
        access_log     /var/log/httpd/domains/my_site.com.bytes bytes;
        expires        max;
        try_files      $uri @fallback;
    }
}

location /error/ {
    alias   /home/my_site/web/my_site.com/document_errors/;
}

location @fallback {
    proxy_pass      http://00.00.000.000:8080;
}

}

In opencart with url my_site/index.php?route=product/category&path=1_2 there is no problems. But if we are using some friendly url like my_site/category_1/category_2 than on page all url starts not with my_site/image but with my_site/category_1/image, so can't load any css, js, image.

enter image description here

How can I fix it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.