Ту которую лучше знаете. Мне ближе debian, кому-то cetos.
vi /etc/nginx/sites-available/horecabar.ru
server {server_name horecabar.ru;listen 80;root /var/www/html/prestashop/;access_log /var/log/nginx/horecabar.ru._access.log;error_log /var/log/nginx/horecabar.ru_error.log;index index.php;rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last;rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last;rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last;rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last;rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last;rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last;rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last;rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last;rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last;rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;try_files $uri $uri/ /index.php?$args;location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {access_log off;expires max;}location ~ \.php {fastcgi_index index.php;fastcgi_split_path_info ^(.+\.php)(.*)$;include /etc/nginx/fastcgi_params;fastcgi_pass unix:/var/run/php7-fpm.sock;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}}
Правила редиректа для nginxhttps://gist.github.com/vicobits/86804fa5f6bd9e2a38f353518563590fУ вас веб сервер не настроен. PHP файлы не обрабатываются. Установите и настройте php-fpm
apt-get install php7.0 php7.0-cli php7.0-common php7.0-fpm php7.0-curl php7.0-zip php7.0-gd php7.0-mysql php7.0-xml php7.0-mcrypt php7.0-mbstring
Правила редиректа для nginxhttps://gist.github.com/vicobits/86804fa5f6bd9e2a38f353518563590f
server { charset utf-8; #listen 95.214.62.218:80; server_name horecabar.ru www.horecabar.ru; root /var/www/html; index index.php; access_log /var/log/nginx/domains/horecabar.ru.log combined; access_log /var/log/nginx/domains/horecabar.ru.bytes bytes; error_log /var/log/nginx/domains/horecabar.ru.error.log error; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { auth_basic off; allow all; log_not_found off; access_log off; } # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). location ~ /\. { deny all; access_log off; log_not_found off; } ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # Do people still use Internet Explorer 6? In that case, disable gzip and hope for the best! gzip_vary on; # Also compress content with other MIME types than "text/html" gzip_types application/json text/css application/javascript; # We only want to compress json, css and js. Compressing images and such isn't worth it gzip_proxied any; gzip_comp_level 6; # Set desired compression ratio, higher is better compression, but slower gzip_buffers 16 8k; # Gzip buffer size gzip_http_version 1.0; # Compress every type of HTTP request # Global rewrite not depending on languages rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite "^/c/([0-9]+)(\-[_a-zA-Z0-9-]*)/(.*)\.jpg$" /img/c/$1$2.jpg last; rewrite "^/c/([_a-zA-Z-]+)/(.*)\.jpg$" /img/c/$1.jpg last; rewrite "^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/(\P{M}\p{M}*)*\.jpg$" /img/p/$1-$2$3.jpg last; rewrite "^/([0-9]+)\-([0-9]+)/(\P{M}\p{M}*)*\.jpg$" /img/p/$1-$2.jpg last; rewrite "^/([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$1$2.jpg last; rewrite "^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$1$2$3.jpg last; rewrite "^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite "^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last; rewrite "^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/(\P{M}\p{M}*)*\.jpg$" /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last; rewrite "^/([0-9]+)\-(\P{M}\p{M}*)+\.html(.*)$" /index.php?controller=product&id_product=$1$3 last; rewrite "^/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /index.php?controller=category&id_category=$1$3 last; rewrite "^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$" /index.php?controller=product&id_product=$2$4 last; rewrite "^/([0-9]+)__([a-zA-Z0-9-]*)(.*)$" /index.php?controller=supplier&id_supplier=$1$3 last; rewrite "^/([0-9]+)_([a-zA-Z0-9-]*)(.*)$" /index.php?controller=manufacturer&id_manufacturer=$1$3 last; rewrite "^/content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /index.php?controller=cms&id_cms=$1$3 last; rewrite "^/content/category/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$" /index.php?controller=cms&id_cms_category=$1$3 last; rewrite "^/module/([_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)$" /index.php?fc=module&module=$1&controller=$2 last; rewrite "^/stock/([_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)$" /index.php?controller=$1$2 last; try_files $uri $uri/ /index.php?$args; # Symfony controllers Specific for 1.7 location ~ /(international|_profiler|module|product|combination|specific-price)/(.*)$ { try_files $uri $uri/ /index.php?q=$uri&$args $admin_dir/index.php$is_args$args; } location /admin-dev/ { # Change this for your admin url if (!-e $request_filename) { rewrite ^/.*$ /admin-dev/index.php last; } } location / { if (!-e $request_filename) { rewrite ^/.*$ /index.php last; } } location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.*)$; try_files $uri =404; fastcgi_keep_conn on; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9002; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_read_timeout 60m; fastcgi_send_timeout 60m; fastcgi_buffer_size 128k; fastcgi_buffers 256 16k; fastcgi_max_temp_file_size 0; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } listen 95.214.62.218:443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/horecabar.ru/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/horecabar.ru/privkey.pem; # managed by Certbot ssl_session_cache shared:le_nginx_SSL:1m; ssl_session_timeout 1440m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:E$ ssl_dhparam /etc/ssl/certs/dhparam.pem; # This is generated by: openssl dhparam -dsaparam -out /etc/ssl/certs/dhparam.pem 4096 if ($scheme != "https") { return 301 https://$host$request_uri; } # managed by Certbot}server { listen 95.214.62.218:80; server_name horecabar.ru; return 301 https://$host$request_uri;}
"2019/02/28 10:04:24 [emerg] 22493#22493: unknown directive "fastcgi_indexindex.php" in /etc/nginx/sites-enabled/horecabar.ru:30"
nginx -t
https://www.howtoforge.com/tutorial/how-to-install-nginx-with-php-and-mysql-lemp-on-debian-9/вот тут про установку debian и nginx php-fpm
2019/02/28 16:37:46 [emerg] 17759#17759: unexpected end of file, expecting "}" in /etc/nginx/sites-enabled/default:922019/02/28 16:51:00 [notice] 17939#17939: signal process started2019/02/28 17:46:39 [error] 17941#17941: *11 directory index of "/var/www/html/" is forbidden, client: 95.211.194.218, server: _, request: "GET / HTTP/1.1", host: "HORECABAR.RU"2019/02/28 17:46:59 [error] 17941#17941: *14 directory index of "/var/www/html/" is forbidden, client: 89.22.16.129, server: _, request: "GET / HTTP/1.1", host: "horecabar.ru"2019/02/28 17:47:01 [error] 17941#17941: *15 directory index of "/var/www/html/" is forbidden, client: 89.22.16.129, server: _, request: "GET / HTTP/1.1", host: "horecabar.ru"2019/02/28 17:47:04 [error] 17941#17941: *16 directory index of "/var/www/html/" is forbidden, client: 89.22.16.129, server: _, request: "GET / HTTP/1.1", host: "horecabar.ru"2019/02/28 17:47:17 [error] 17941#17941: *18 FastCGI sent in stderr: "PHP message: PHP Warning: require(/var/www/html/config/config.inc.php): failed to open stream: Permission denied in /var/www/html/index.php on line 27PHP message: PHP Fatal error: require(): Failed opening required '/var/www/html/config/config.inc.php' (include_path='.:/usr/share/php') in /var/www/html/index.php on line 27" while reading response header from upstream, client: 89.22.16.129, server: _, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "horecabar.ru"2019/02/28 17:47:43 [error] 17941#17941: *21 directory index of "/var/www/html/" is forbidden, client: 89.22.16.129, server: _, request: "GET / HTTP/1.1", host: "horecabar.ru"2019/02/28 17:47:46 [error] 17941#17941: *23 directory index of "/var/www/html/" is forbidden, client: 192.42.116.24, server: _, request: "GET / HTTP/1.1", host: "horecabar.ru"