Настройка VPS

Автор VoyDi, 21 февраля 2019, 13:02:14

« назад - далее »

VoyDi

Цитата: Mr.Sen от 22 апреля 2019, 17:19:49
В htaccess можно запретить доступ к сайту с ip
Deny from xxx.xxx.xxx.xxx

не помогло

у меня Debian 9 + Nginx

Mr.Sen


VoyDi

Цитата: Mr.Sen от 22 апреля 2019, 21:11:03
location / {
    deny xxx.xxx.xxx.xxx;
}


Спасибо, помогло. Правда эти гады сегодня с двух новых IP написали.

Falconer

#78
Подскажите что исправить в .conf что бы 404 не вылезали? Ubuntu 18.04

Цитировать
server {
server_name site.ru www.site.ru;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/site.ru/*.conf;
access_log /var/www/httpd-logs/site.ru.access.log;
error_log /var/www/httpd-logs/site.ru.error.log notice;
ssi on;
set $root_path /var/www/site/data/www/site.ru;
root $root_path;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
return 301 https://$host:443$request_uri;
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
listen 111.111.11.111:80 default_server;
}
server {
server_name site.ru www.site.ru;
ssl_certificate "/var/www/httpd-cert/site/site.ru_le1.crtca";
ssl_certificate_key "/var/www/httpd-cert/site/site.ru_le1.key";
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
add_header Strict-Transport-Security "max-age=31536000;";
ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/site.ru/*.conf;
access_log /var/www/httpd-logs/site.ru.access.log;
error_log /var/www/httpd-logs/site.ru.error.log notice;
ssi on;
set $root_path /var/www/site/data/www/site.ru;
root $root_path;
location / {
location ~ [^/]\.ph(p\d*|tml)$ {
try_files /does_not_exists @fallback;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
try_files $uri $uri/ @fallback;
}
location / {
try_files /does_not_exists @fallback;
}
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://127.0.0.1:8080 /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
access_log off;
}
listen 11.111.11.111:443 ssl default_server;
}

coder

Для prestashop 1.7 конфиг nginx
https://devdocs.prestashop.com/1.7/basics/installation/nginx/
правила редиректа
rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last;
rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$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])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last;
rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last;
rewrite ^/images_ie/?([^/]+).(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;
rewrite ^/order$ /index.php?controller=order last;
location /admin-dev/ {                           #Change this to your admin folder
    if (!-e $request_filename) {
        rewrite ^/.*$ /admin-dev/index.php last; #Change this to your admin folder
    }
}
location / {
    if (!-e $request_filename) {
        rewrite ^/.*$ /index.php last;
    }
}

AlexLSL

#80
Всем привет, ребята подскажите, сейчас ситуация с VPS какая?
Хочу попробовать перенести на VPS три сайта. Один сейчас на presta 1.7 php 7.0, а может и 7.1, второй на presta 1.6.24 тоже php 7.0, а третий древний динозавр на OS Commerce какой то древней версии, работает на 5.5 php.
Что бы вы посоветовали в плане OS, апачей пхп и всего остального? Не понимаю как сделать чтобы и 7 и 5 пхп работали, надо два устанавливать или это через настройки какие то делается.

mAgency

Цитата: Виталий от 17 ноября 2015, 11:00:21
VPS для Prestashop:
- Nginx
- MariaDB
- Php5-fpm 5.6.x
позволяет добиться максимальной производительности.
Еще установите php 7.0 и 7.3. В файле конф ngnix для каждого сайта можно указать версию php.
fastcgi_pass unix:/var/lib/phpX.X-fpm/siteX.sock;
Интернет-магазин под ключ.
Какой выбрать движок для интернет магазина ?
Какой движок лучше ?
Magento или Prestashop ?
Решение всех Ваших вопросов в создании Интернет-магазина.