Перейти к содержанию
Официальный форум поддержки Simpla

Рекомендуемые сообщения

Добрый день!

Использую на сервере NGINX, поставил демо версию, она категорически не хочет работать, но админка работает.
Как проверить работоспособность?
Мне нужен стабильная система управления контентом, что бы не возникало ошибок при работе на больших нагрузках.

Ссылка на сообщение
Поделиться на другие сайты

В Симпле используется модуль apache mod_rewrite. Но правила можно переписать под nginx, возможно кто-то это уже сделал?

Ссылка на сообщение
Поделиться на другие сайты

использую nginx перед apache - он отдаёт статику, а контент по прежнему генерит apache. можно подправить конфиг под редирект на php-fpm, но при этом есть свои сложности, например, не будет работать смена пароля в админке.

nginx.conf:

user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
worker_rlimit_nofile 10240;
events {
use epoll;
worker_connections 10240;
}
http {
log_not_found off;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] $status "$request" $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
log_format common '$remote_addr [$time_local] $status $bytes_sent "$request" "$http_referer" "$http_user_agent" $msec';
access_log /var/log/nginx/access.log common;
error_log /var/log/nginx/error.log warn;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 64k;
proxy_buffers 8 64k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 10m;
proxy_set_header Range "";
proxy_set_header Request-Range "";
server_names_hash_bucket_size 128;
gzip on;
keepalive_timeout 0;
gzip_proxied any;
gzip_types application/x-javascript text/css;
server {
listen 80;
server_name имясайта;
access_log /var/log/nginx/access_имясайта.log common;
## Rewrite rules for simpla
# Каталог товаров
rewrite ^/catalog/([^/]+)/([^/]+)/?$ /index.php?module=ProductsView&category=$1&brand=$2;
rewrite ^/catalog/([^/]+)/?$ /index.php?module=ProductsView&category=$1;
rewrite ^/products/([^/]+)/?$ /index.php?module=ProductView&product_url=$1;
rewrite ^/products/?$ /index.php?module=ProductsView;
rewrite ^/brands/([^/]+)/?$ /index.php?module=ProductsView&brand=$1;
rewrite ^/brands/([^/]+)/page_([^/]+)/?$ /index.php?module=ProductsView&brand=$1&page=$2;
# Поиск товаров
rewrite ^/search/([^/]+)/?$ /index.php?module=ProductsView&keyword=$1;
rewrite ^/search/?$ /index.php?module=ProductsView;
# Блог
#rewrite ^/blog/([^/]+)/?$ /index.php?module=BlogView&url=$1;
#rewrite ^/blog/?$ /index.php?module=BlogView;
# Корзина и заказы
rewrite ^/cart/?$ /index.php?module=CartView;
rewrite ^/cart/([^/]+)/?$ /index.php?module=CartView&add_variant=$1;
rewrite ^/cart/удалить/([^/]+)/?$ /index.php?module=CartView&delete_variant=$1;
rewrite ^/order/([^/]+)/?$ /index.php?module=OrderView&url=$1;
rewrite ^/order/?$ /index.php?module=OrderView;
# Для пользователей
rewrite ^/user/login/?$ /index.php?module=LoginView;
rewrite ^/user/register/?$ /index.php?module=RegisterView;
rewrite ^/user/logout/?$ /index.php?module=LoginView&action=logout;
rewrite ^/user/password_remind/?$ /index.php?module=LoginView&action=password_remind;
rewrite ^/user/password_remind/([0-9a-z]+)/?$ /index.php?module=LoginView&action=password_remind&code=$1;
rewrite ^/user/?$ /index.php?module=UserView;
# Прочее
rewrite ^/sitemap.xml?$ /sitemap.php;
rewrite ^/yandex.xml?$ /yandex.php;
rewrite ^/contact/?$ /index.php?module=FeedbackView;
rewrite ^/order/([^/]+)/([^/]+)/?$ /index.php?module=OrderView&url=$1&file=$2;
# End rewrite for simpla
location / {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://имясайта:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~* ^.+\.(jpg|jpeg|gif|png|svg|ico|txt|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
root /var/www/html/имясайта;
try_files $uri $uri/ @fallback;
access_log off;
expires max;
}
location ~ /\.ht {
deny all;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
proxy_redirect http://имясайта:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
}

Ссылка на сообщение
Поделиться на другие сайты

alpmaster - спасибо, буду тестировать:)
granata005 - не важно обычный или нет, главное результат и суть ответа.

За ранее всем спасибо, по результатам тестов - отпишусь!

Ссылка на сообщение
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

Загрузка...
×
×
  • Создать...