Hi All,
Installed Nginx + PHP-FPM (centminmod). There is no apache.
The question arises, where to get instructions for nginx, which are written in htaccess.txt files. I don’t know how to translate Apache instructions into nginx instructions. Can someone give their settings?
OpenCart2.3
Nginx Version: 1.17.3
PHP 5.6.40
Centos7
Centminmod
Thanks
Code: Select all
server {
listen 80;
listen [::]:80;
root /var/www/kinbuweb/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name kinbu.localhost;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Last edited by straightlight on Sat Apr 04, 2020 5:04 pm, edited 1 time in total.
Reason: Added code tags.
Reason: Added code tags.
Let's try.
any opinions?
Code: Select all
location / { try_files $uri @opencart; }
location ~* ^/admin/cron/ { allow 127.0.0.1; deny all; }
location ~* ^/system/ { allow 127.0.0.1; deny all; }
location ~* \/\.ht { deny all; }
location ~* (\.tpl|.twig|\.ini|\.log|(?<!robots)\.txt) { deny all; }
location ~* \/\.git { deny all; }
location ~* \/image.+(\.php) { deny all; }
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; }
location = /sitemap.xml { rewrite ^(.*)$ /index.php?route=extension/feed/google_sitemap last; }
location = /googlebase.xml { rewrite ^(.*)$ /index.php?route=extension/feed/google_base last; }
location /system { rewrite ^/system/storage/(.*) /index.php?route=error/not_found last; }
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { allow all; log_not_found off; access_log off; }
location /admin { index index.php; }
location @opencart { rewrite ^/(.+)$ /index.php?_route_=$1 last; }
Who is online
Users browsing this forum: No registered users and 16 guests