ProthomAlo.Online

Get Help & Tips About Technology

nginx vs apache cloud Best Speed Server for You

Apache server is a lot better

nginx are better than them , nginx Very Fast Server, Quickly view



But engine some mistake For Cloud Service VPS .htaccess not working

.htaccess If work is done

Okay, try replacing the HTTP server location block with this:

location = /exchange_1С_Opencart.php {
try_files $uri =404;
}
location = /TEMP {
try_files $uri $uri/ =404;
}
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/staticfiles.conf;

Again, it’s a mess. If it doesn’t work, then contact the developer to fix the PHP file.
Otherwise you need to redo the entire Nginx configuration from beginning without a wizard.

@mianofv
By the way, made a little error in the config.
This $server_name/$request_uri should be $server_name$request_uri

.htaccess does not exists in Nginx. That’s one of the reasons why Nginx is so fast, since nothing is loaded dynamically as Apache.

Can you use the code-button in this editor, because currently it removes underscores and other characters.
Is the idea to load some elements over HTTP and not HTTPS? Why?

Thank you for your answers. I have a program installed on my computer in my shop which synchronizes products to my OpenCart . My OpenCart is with HTTPS, but that OpenCart module works only with HTTP. So I need to force those files to redirect to HTTP only. The developer only gave Apache rules.

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:X-HTTPS} !1
RewriteCond %{REQUESTURI} !^/exchange1СOpencart.php$
RewriteCond %{REQUESTURI} !^/TEMP$
RewriteRule ^(.)$ https://%{HTTPHOST}/$1 [R=301,L]
RewriteCond %{HTTP:X-HTTPS} 1 [NC]
RewriteCond %{REQUESTURI} ^/exchange1СOpencart.php$
RewriteCond %{REQUEST_URI} ^/TEMP$
RewriteRule ^(.)$ http://%{HTTP_HOST}/$1 [R=301,L]

You need to copy your original code and place it within the code-tags – not the one from the first post, since it’s already distorted.

Ok, sorry. This should be ok.

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:X-HTTPS} !1
RewriteCond %{REQUEST_URI} !^/exchange_1С_Opencart.php$
RewriteCond %{REQUEST_URI} !^/TEMP$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTP:X-HTTPS} 1 [NC]
RewriteCond %{REQUEST_URI} ^/exchange_1С_Opencart.php$
RewriteCond %{REQUEST_URI} ^/TEMP$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} !^/exchange_1С_Opencart.php$ [NC]
RewriteCond %{REQUEST_URI} !^/TEMP$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L,QSA]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(/exchange_1С_Opencart.php)$ http://%{HTTP_HOST}/$1 [R=301,L,QSA]
RewriteRule ^(/TEMP)$ http://%{HTTP_HOST}/$1 [R=301,L,QSA]

Updated: June 13, 2019 — 12:36 pm

The Author

1 Comment

Add a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

ProthomAlo.Online © 2017
PHP Code Snippets Powered By : XYZScripts.com